Start a promise chain in Bluebird Q-style

published Oct 03, 2015 04:12   by admin ( last modified Oct 03, 2015 04:12 )

You can start a promise chain in the javascript library Q with a data item, like so:

Q([foo:'bar}).then( ...

How do you do that in the Bluebird javascript library?

One way is like this:

Promise.resolve([foo:'bar}).then( ...
One of the simplest is calling Promise.resolve() on nothing:

Read more: Link - javascript - Define empty Bluebird promise like in Q - Stack Overflow