You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should provide a support module for working with promises.
// Can be imported by path and using destructuringconst{ fork }=require('ferrum/async');const{async: { fork }}=require('ferrum');// Promise constructor as a free functionconstmakePromise=builder(Promise);// Mostly useful as an annotation in code that this starts a new fiberconstfork=(fn)=>Promise.resolve(fn(v));// Fork from a sequence; useful because Promise.all cannot be used as a free function; needs a better nameconstparallel=(seq)=>Promise.all(iter(seq));// Iterate over a sequence of promises in the order they resolve (multiple races). Returns async iterator (needs better name)constrace_all=…constrace=(seq)=>Promise.race(iter(seq));// Promise with resolve/rejectclassBarrierextendsPromise{constructor(fn/* maybe null */){}resolve(v){}reject(v){}intoPromise(){}};// WaitEventconstwaitEvent=(emitter,eventName)=>makePromise((res)=>classChannel{constructor}
We should provide a support module for working with promises.
Functions from: https://github.com/adobe-rnd/helix-harmonicabsorber/blob/master/src/asyncio.js
The text was updated successfully, but these errors were encountered: