Object/method based middleware/reduce hooks
Middleware(ish) hooks based on "methods" in objects.
(Also see examples/)
var middleware = require'middleware-object-hooks';middlwareusevaluecalls = valuecalls || 0;return value;;middlwareusevaluecalls++;;middlwareusereturn// do some magic then accept / reject;;middlwarerun'start' // method in the middleware// passed to the method in the middlewarethen;
Middleware methods are invoked within the context of their object
Multiple values may be passed to run (or none at all)
Each result is passed directly to the next middleware so its possible to both mutate the value (if its an object) and entirely replace it.