func-pool
Execute functions sequentially and modify (add, delete, sort) the order of execution when needed
Install
npm i func-pool
Quick Examples
;const funcPool = ; { console; } { console; } funcPool;funcPool;// print 'hello'// print 'goodbye' funcPool;funcPool;// print 'hello' funcPool;funcPool;// print 'goodbye'// print 'hello' funcPoolclear;funcPool;// print nothing
Methods
autoRun(Function | Array<Function>)
autoRun
accept a function or an array of functions and will add to the update queue
removeFromAutoRun(Function | Array<Function>)
removeFromAutoRun
accept a function or an array of functions and will remove the corresponding method from the update queue
update(): Promise<Array>
Call the update
method will call the function in the queue in sequence and return a Promise Object
clear()
clear update queue