doto
A flow-control/threading HoF. The name was stolen from Clojure.
API
module.exports = function doto (target, steps, [callback])
Apply each function in steps
to target
in order. For example:
var assert = var doto = var result = assert
You may pass additional arguments to a step (other than target
, which is always
the first argument) by using an array instead of a function:
var { ok = v }var result =
If a callback is provided, all steps are assumed to be asynchronous, and will
receive a next
function as their last argument:
License
BSD-2-Clause