Use Case
I put an object on the scope of the template - let's call it o - and I would like to make it super easy for template authors to serialize it to a string representation. What I have in mind is to call my serialization function from the method valueOf() of my Drop, which would provide the following authoring experience:
# Returns the identifier of the object
{{ o.id }}
# Returns a string representation of the object
{{ o }}
Problem
The problem is that my serialization function is async and, instead of getting the string representation, I get [object Promise]. That behavior is different than e.g. liquidMethodMissing() that awaits promises.
Use Case
I put an object on the scope of the template - let's call it
o- and I would like to make it super easy for template authors to serialize it to a string representation. What I have in mind is to call my serialization function from the methodvalueOf()of myDrop, which would provide the following authoring experience:Problem
The problem is that my serialization function is
asyncand, instead of getting the string representation, I get[object Promise]. That behavior is different than e.g.liquidMethodMissing()that awaits promises.