I saw an old thread referencing Promises, but can't seem to find an official Promise module anywhere. I tried an implementation by @favo from this thread but a simple console.log() test had erroneous results where callbacks occurred before resolutions.
Trying to save a bit of time myself and hoping this was already implemented.
It's built-in to all the new firmwares: http://www.espruino.com/Reference#Promise
I guess you're using ESP8266 so I'm not sure if you're using a build that has it disabled or something, but on an official board with up to date firmware then it's just already there as soon as you type new Promise(...)
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem