1.0.1 • Published 9 years ago

filter-pipe v1.0.1

Weekly downloads
17
License
MIT
Repository
github
Last release
9 years ago

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