A Promise is a type of object that serves as a placeholder for a future result, for example, the body of an HTTP request or the return value of a call to the Meteor method. Basically, any function that forces you to go through a callback to get its return value (instead of just returning it) is called the async function, and the value it returns can be represented by a promise.
The problem with Meteor is that helper methods are only designed to work with synchronous values - for example, text on a web page or the contents of a Minimongo collection. When you return Promise from one, helper
- shows
[object Promise] instead of the allowed value - not updated when promise resolves
Some attempts to solve this exist: simple: reactive method and arsnebula: reactive promises , but they require that you change your assistants in a certain style or work only with Meteor.call , and not just provide general promises to return.
Is there something existing that I forgot, or is there a solution to the job? I have been experimenting with this for some time and can work on something myself if there is no official answer.
meteor meteor-blaze
Dean radcliffe
source share