loop-promise
Run infinite loops with promises. Cancellation enabled if using Bluebird.
Usage
- Plain node
Promise addMethod: true; let loopPromise = Promise;// running interval will be timeToRunLoopBody + 100ms loopPromise; // if Promise comes from bluebird and cancellation is enabled then you can also cancel the loop// otherwise cancelling could done manually by throwing a pre-defined error and catching it outsideloopPromise;
You can also pass values through loop iterations
Promise; // 0 is the initial value passed to the loop body