Tasks
Manager for task list
Installation
Use the package manager npm to install Tasks.
npm install @ijx/tasks
List of methods
constructor(config?: object)
ConstructoronEnd(func: function): Tasks
Execute function after end eventadd(action: function|object): Tasks
Add new task to listprocess(): void
Start to process task listpause(): void
Pause task listreset(): void
Clear task list and stop
Example usage
import Tasks from "@ijx/tasks"
const tasks = new Tasks({
auto: true
});
tasks.onEnd(() => console.log("Finish all tasks!"));
tasks.add(async () => {
});
tasks.add(async () => {
});