3 ms·
No built-in help with native promises, but with something like Bluebird you'd prefer: something().then(() => { return Promise.delay(1000).then(() =>
by phs2501 11y ago
No built-in help with native promises, but with something like Bluebird you'd prefer:
something().then(() => {
return Promise.delay(1000).then(() => {
whoops_not_a_function();
});
}).catch(() => {
// whoops_not_a_function is not defined
});
...or write Promise_delay yourself on top of native promises (but really just use Bluebird).