Compose Iterator
Use iterator for middleware composition.
Installation
$ npm install compose-iterator
Examples
compose.js
'use strict' const Promise = const iterator = /** * Expose compositor. */ moduleexports = compose /** * Compose `middleware` returning * a fully valid middleware comprised * of all those which are passed. * * @param * @return * @api public */ { if !Array throw 'Middleware stack must be an array!' for const fn of middleware if typeof fn !== 'function' throw 'Middleware must be composed of functions!' /** * @param * @return * @api public */ return { // iteration object const iter = iteratorSymboliteratormiddleware context next try return Promise catch err return Promise }}
app.js
const co = const compose = { return } var arr = var stack = stack stack stack {}