Delay promise
A ES6 promise wrapper library to throttle and batch promises
const delayed = ; // A sample promise which takes an argument { console; return { ; };};
delayed.creator
creates a wrapper function the promise which allows the delaying of the promise execution
const promiseCreator = delayed;
Both delayed.series
and delayed.parallel
accepts an array of delayed.creator
objects
Sequentially execute an array of delayed creators
with the delay of 1 second between each promise
delayed;
To produce a throttled or staggered effect use delayed.parallel
Parallelly execute an array of delayed creators
with the delay of 1 second between each promise
delayed;
Use both parallel
and series
for throttling and batching
const batch1 = delayed; // 1 second delay between each parallel promise const batch2 = delayed; // 1 second delay between each parallel promise // 1 second delay between each batchdelayed;