react-pocket
A framework that helps you do state-management in React without redux or mobx. Light, simple and easy. Just write some intimate jquery-style codes like $('MyComponent').setProp({foo: 'bar'})
anywhere. That's enough!
Installation
npm install --save react-pocket
Quick Look
Let's take an example. There are three component files Card.js
,Timer.js
,Counter.js
, which are aggregated to simply play a feature of counting. The following is the structure.
-- Card
|
-- Timer
|
-- Counter
What if you want to change the number of Counter just in Card.js
. react-pocket offers you ability to do so! Here are the code examples.
/*Card.js*/ import $ from 'react-pocket';import Timer from './Timer'; { ; } return <div> <Time/> </div>
/*Timer.js*/ import $ from 'react-pocket';import Counter from './Counter'; return <div> <Counter/> </div>
/*Counter.js*/ import $ from 'react-pocket'; { ; } { return num: 0 } { return <h3> thispropsnum </h3> }
You can get the full example here.
License
MIT