natron-core
v0.2.0-beta.5
Published
Tasks with Promises
Downloads
4
Readme
Tasks with Promises
This module is part of Natron and contains the core functionality of the task runner.
Documentation
See the documentation for natron-core.
Usage
import {task} from "natron-core";
function fn1(x) { return x * 1; }
function fn2(x) { return x * 2; }
function fn3(x) { return x * 3; }
// => fn1(2) -> (fn2(2) || fn3(2))
(task([fn1, [[fn2, fn3]]]).run(2)
.then((res) => {
// res = [2, [4, 6]]
})
.catch((err) => {
// handle error
})
);