File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
Simple React state management. Made with :heart : and ES6 Proxies.
4
4
5
- [ ![ Build] ( https://img.shields.io/circleci/project/github/solkimicreb/react-easy-state/master.svg )] ( https://circleci.com/gh/solkimicreb/react-easy-state/tree/master ) [ ![ Coverage Status] ( https://coveralls.io/repos/github/ solkimicreb/react-easy-state/badge .svg?branch=master&service=github )] ( https://coveralls.io/github/ solkimicreb/react-easy-state?branch=master ) [ ![ JavaScript Style Guide ] ( https://img.shields. io/badge/code_style-standard-brightgreen .svg )] ( https://standardjs.com ) [ ![ Package size] ( https://img.shields.io/bundlephobia/minzip/react-easy-state.svg )] ( https://bundlephobia.com/result?p=react-easy-state ) [ ![ Version] ( https://img.shields.io/npm/v/react-easy-state.svg )] ( https://www.npmjs.com/package/react-easy-state ) [ ![ dependencies Status ] ( https://david-dm.org/solkimicreb/react-easy-state/status.svg )] ( https://david-dm.org/solkimicreb /react-easy-state) [ ![ License] ( https://img.shields.io/npm/l/react-easy-state.svg )] ( https://www.npmjs.com/package/react-easy-state )
5
+ [ ![ Build] ( https://img.shields.io/circleci/project/github/solkimicreb/react-easy-state/master.svg )] ( https://circleci.com/gh/solkimicreb/react-easy-state/tree/master ) [ ![ dependencies Status] ( https://david-dm.org/ solkimicreb/react-easy-state/status .svg )] ( https://david-dm.org/ solkimicreb/react-easy-state ) [ ![ Coverage Status ] ( https://coveralls. io/repos/github/solkimicreb/react-easy-state/badge .svg?branch=master&service=github )] ( https://coveralls.io/github/solkimicreb/react-easy-state?branch=master ) [ ![ Package size] ( https://img.shields.io/bundlephobia/minzip/react-easy-state.svg )] ( https://bundlephobia.com/result?p=react-easy-state ) [ ![ Version] ( https://img.shields.io/npm/v/react-easy-state.svg )] ( https://www.npmjs.com/package/react-easy-state ) [ ![ License] ( https://img.shields.io/npm/l/react-easy-state.svg )] ( https://www.npmjs.com/package/react-easy-state )
6
6
7
7
<a href =" #platform-support " ><img src =" images/browser_support.png " alt =" Browser support " width =" 450px " /></a >
8
8
@@ -40,12 +40,10 @@ React Easy State is a practical state management library with two functions and
40
40
import React from ' react'
41
41
import { store , view } from ' react-easy-state'
42
42
43
- const counter = store ({
44
- num: 0 ,
45
- incr : () => counter .num ++
46
- })
43
+ const count = store ({ num: 0 })
44
+ const increment = () => count .num ++
47
45
48
- export default view (() => (< button onClick= {counter . incr }> {counter .num }< / button> ))
46
+ export default view (() => (< button onClick= {increment }> {count .num }< / button> ))
49
47
```
50
48
51
49
This is enough for it to automatically update your views when needed. It doesn't matter how you structure or mutate your state stores, any syntactically valid code works.
You can’t perform that action at this time.
0 commit comments