Open bahmutov opened 8 years ago
This will allow simple partial application, unlike this
function add(a, b) { return a + b }
const makeAdd2 = voTask(add.bind(null, 2))
const add2to5 = makeAdd2(5)
add2to5.fork(...) // result is 7
We have to use Function.prototype.bind
because voTask works well with generators, while partial application utils, like lodash _.partial
do not work with generators.
We could combine arguments to the initial wrap and the final task making call