2.4.9 • Published 7 years ago
@detach/loop v2.4.9
loop
install
npm install --save @detach/loop
usage
The following loop will run all tasks once, in place.
import loop from "@detach/loop";
loop()
.do(() => console.log("how are you?"))
.do(() => console.log("good"))
.once();methods
These methods are available to Loop objects.
| Method | Description |
|---|---|
once(?async) | Perform the loop once. |
forever(?async) | Perform the loop infinitely. |
cancel() | Cancel a forever loop. |
async or sync
By default all loops are synchronous, however it is easy to change that.
Simply pass a boolean to the .once or .forever methods, for an asynchronous loop use true.
contribute
Pull requests are encouraged.
2.4.9
7 years ago