liquidMethodMissing doesn't support object promises
See original GitHub issueHi,
In attempt to implement a drop, i am trying to return an object from liquidMethodMissing method in order to lazily load objects.
For example:
class ProductsDrop extends Drop{
constructor(api) {
super()
}
async liquidMethodMissing(productHandle) {
const product = this.api.getProductByHandle(productHandle)
if (product) return product else return null
}
}
and to call it as, for example: {{products[‘product handle’].name]}}
However, it seems that liquidMethodMissing supports only string type Promises.
public liquidMethodMissing (key: string): Promise<string | undefined> | string | undefined {
return undefined
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
jQuery Deferred and promise - Error: Object doesn't support ...
I've got the first deferred method built and the console log shows that it completes, but then I get "Error: Object doesn't support...
Read more >Promise - JavaScript - MDN Web Docs
Creates a new Promise object. The constructor is primarily used to wrap functions that do not already support promises.
Read more >JavaScript Promises – The promise.then, promise.catch and ...
A promise is an object in JavaScript that will produce a value sometime in the future. This usually applies to asynchronous operations.
Read more >Runtime and compile-time metaprogramming - Apache Groovy
This way of using methodMissing does not have the overhead of invokeMethod and is not expensive from the second call on. 1.4. propertyMissing....
Read more >JavaScript Promises by james-priest
“The Promise object is used for deferred and asynchronous computations.” ... Note: the JavaScript engine does not immediately stop executing this function ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to resolve the issue by adding a simple condition to the readProperty function, i am not sure if it breaks something else!
Then it’s a bug, we should fix it. Thank you for your work!