X-block
It is npm package, for using global state as redux state, but change state as mobx state.
- You do not need to wrap many components in mobx "observer"
- Use "connect" from react-redux only where you need it
- Change state directly or with methods, without hard reducers.
- Change state asynchronously
Include hot module replacement with saving current state.
Install
$ npm install x-block --save
Usage
;; const counter = scopeName: 'counter' state: itt: 0 { thisstateitt++; } { thisstateitt--; };; const Counter = <div> <p>p_itt</p> <div> <button onClick= counter > Increment </button> </div> <div> <button onClick= counter > Decrement </button> </div> <div> <button onClick= {counterstateitt++} > Increment state directly </button> </div> <div> <button onClick= {counterstateitt--} > Decrement state directly </button> </div> </div>; ;