Another Clojure-style atom library for javascript
npm install re-atomA library providing simple Clojure atom-inspired state management (for React)
[![NPM Version][npm-image]][npm-url]
```
npm install --save re-atom
type Module = {
initialState: mixed,
actions: { [string]: (AtomInterface, ...args: Array
actionGenerators: { [string]: ActionGenerator },
modules: { [string]: Module },
}
type ActionGenerator = AtomInterface => ActionType
Middleware functions have the following signature: (next) => (initialState, resetFn, actionFn) => void.(oldState, newState) => void
The resetFn signature is: .(scope, actionHandler, params, actionPath) => void
The actionFn signature is: .
xf = (oldState, ...args) => newState
watcherFn = (atom, newState, oldState) => void
mapStateFn = (state, ownProps) => propsmapActionsFn = (atom, ownProps) => actionProps`
[npm-image]: https://img.shields.io/npm/v/re-atom.svg
[npm-url]: https://npmjs.org/package/re-atom