filter-pipe
v1.0.1
Published
Pass a value through synchronous filter functions
Downloads
303
Readme
filter-pipe
Pass a value through synchronous filter functions
Install
$ npm install --save filter-pipe
Usage
var filter = require('filter-pipe')
var submitValid = pipe(isValid, submit)
submitValid({name: 'B'})
//=> submit not called
function isValid (value) {
return value.name.length > 1
}
function submit (value) {
sendToServer(value)
}
API
filter(functions...)
-> function
functions
Required
Type: function
/ array[function]
A set of functions to use to filter the value. At least one is required. You can pass the functions as arguments or pass a single array of functions.
License
MIT © Ben Drucker