0.4.1 • Published 10 years ago

reduxer v0.4.1

Weekly downloads
8
License
MIT
Repository
github
Last release
10 years ago

reduxer

NPM

reduxer is a stream api that works like redux.

example

var redux = require('reduxer')

var counter = redux((state=0, chunk) => {
  switch (chunk) {
  case 'INCREMENT':
    return state + 1
  case 'DECREMENT':
    return state - 1
  default:
    return state
  }
})

counter.on('data', (data) => 
  console.log(data)
)

counter.write('INCREMENT')
// 1
counter.write('INCREMENT')
// 2
counter.write('DECREMENT')
// 1

install

npm install reduxer

api

redux([options,] fn)

Create a Redux instance.

redux.obj([options,] fn)

Create a Redux instance with { objectMode: true }.

redux.ctor([options,] fn)

Create a Redux class.

options

  • all through2 options and an optional initial state object

attribution

Thanks to brycebaril. Borrowed from through2-reduce.

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago