Upstore
providerless state container with React bindings. Includes UMD build
Install
npm
npm i -s upstore
or
yarn
yarn add upstore
Usage
store.js
;; const counterReducer = { };const fetchDataReducer = { return data;};const reducers = counter: counterReducer data: fetchDataReducer; const store = counter: 0 reducers; const actions = store; ;
App.js
;;; <div> <Counter /> <FetchData /> </div>;
components/Counter.js
; ;; <Fragment> <Connect store=store filterState= { return counter: statecounter ; } > <div> <h2>Counter Example</h2> <p>statecounter</p> <button onClick=actionsdecrement>decrement</button> <button onClick=actionsincrement>increment</button> </div> </Connect> </Fragment>;
components/FetchData.js
; ;; <Fragment> <Connect store=store filterState= { return data: statedata ; } > { return <div> <h2>Async Data Fetch Example</h2> <button onClick=actionsfetchData > fetch data </button> <pre>JSON</pre> </div> ; } </Connect> </Fragment>;
API
coming soon...