On 2/3/16 11:39 PM, Bob Myers wrote:
Promise.resolve(42) . then(wait(1000)) . then( /* cb */);

With ES6 I prefer the straightforward:

    var wait = ms => new Promise(resolve => setTimeout(resolve, ms));

    Promise.resolve(42) . then(() => wait(1000)).then(() => { /* cb */ });

 Too simple to standardize IMHO.

.: Jan-Ivar :.

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to