Home

Awesome

send-action

A tiny module for managing state.

npm travis standard conduct

Install

npm install send-action

Minimal example

var createStore = require('send-action')

var state = {
  items: []
}

var actions = {
  setItem: function (state, data) {
    state.items.push(data)
    return state
  }
}

function onChange (state, action) {
  // render app
  console.log(state, action)
}

var send = createStore({
  state: state,
  actions: actions,
  onChange: onChange
})

send('setItem', { title: 'hi' })

See also

Contributing

Contributions are welcome! Please read the contributing guidelines first.

Conduct

Help keep this project open and inclusive. Please read and follow the code of conduct

Changelog

Read about the changes to this project in CHANGELOG.md. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Contact

License

MIT