trantran
v0.0.4
Published
A simple task runner
Downloads
2
Maintainers
Readme
trantran
🚀 A simple task executor
const context: Context = {
/*...*/
}; // Whatever you want to provide to your tasks!
const bendSpoon = new Task<Context>({
name: "bending-spoon",
run: (context: Context) => {
/*...*/
},
});
const spinTheWheel = new Task<Context>({
name: "spin-the-wheel",
run: async (context: Context) => {
/*...*/
},
});
const doTheMagic = new Task<Context>({
name: "do-the-magic",
dependencies: [bendSpoon, spinTheWheel],
});
const runner = new Runner(context);
await runner.runTasks(doTheMagic);