set-state-redux
Love and setState
is all you need.
Installation
npm install --save set-state-redux
Usage
const redux = const setStateRedux = // Reducers are optional. You can create a store without one. { } // Decorate `redux.createStore`const createStoreWithSetState = setStateRedux // Use `createStoreWithSetState` as `redux.createStore`const store = // Choose between dispatching actions...store // Or using `setState` directlystore
FAQ
Why you did this? This is not blessed by the Holy Church of React!
Redux is an awesome piece of software, but too verbose to my needs.
What I just need is setState
. Actually what I need is unistore,
but there is already a lot of code coupled with Redux on my current project.
Consider this an intermediate solution.
This is a piece of shit! I'll not use that!
Whatever floats your boat, my dude. I'll use this shit because it's simpler and because shit floats as well.
You will lose time travel and all other nice things Redux give to you if you follow the conventions!
Actually not. There is a reducer under the hood, so everything is still supported.
Related
caiogondim.com · GitHub @caiogondim · Twitter @caio_gondim