javascript - Promise.allSettled in babel ES6 implementation -


i'm using babel transpile node.js@0.10.x code , i'm stuck promises.

i need allsettled-type functionality use in q , bluebird or angular.$q example.

on babel's core-js promise, there no allsettled method.

currently i'm using q.allsettled workaround:

import { allsettled } 'q';

is there in babel polyfill? alternatively, algorithm me try implement?

alternatively, algorithm me try implement?

  1. create new promise executor function
  2. use counter/result array in scope of executor
  3. register then() callback each parent promise saving results in array
  4. resolve/reject promise step 1 when counter indicates parent promises done

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -