petiole-reducers

0.3.1 • Public • Published

petiole-reducers

Utility library for writing cleaner Petiole reducers.

Installation

npm install petiole-reducers --save

Usage

pluck

Returns the value from the action with the supplied property name.

(propName) => (action, state) => any

{
  initialState: {
    name: null,
  },
  actions: {
    setName: 'newName',
  },
  reducers: {
    setName: merge({
      name: pluck('newName'),
    })
  },
}

merge

(objectToMerge) => (action, state) => object

replace

(object) => (action, state) => object

push

(item) => (action, state) => array

remove

(predicate) => (action, state) => array

add

(number) => (action, state) => number

subtract

(number) => (action, state) => number

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.3.11latest

Version History

VersionDownloads (Last 7 Days)Published
0.3.11
0.1.00

Package Sidebar

Install

npm i petiole-reducers

Weekly Downloads

1

Version

0.3.1

License

MIT

Last publish

Collaborators

  • ilkkahanninen