filter-pipe

1.0.1 • Public • Published

filter-pipe Build Status

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

Readme

Keywords

Package Sidebar

Install

npm i filter-pipe

Weekly Downloads

42

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bendrucker