@t8/react-store 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +20 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,10 +4,26 @@
4
4
 
5
5
  *Concise shared state management for React apps*
6
6
 
7
- - Similar to `useState()`
8
- - No boilerplate
9
- - Painless transition from local state
10
- - SSR-compatible
7
+ 🔹 Similar to `useState()`
8
+
9
+ ```diff
10
+ + let store = new Store(0);
11
+
12
+ let Counter = () => {
13
+ - let [counter, setCounter] = useState(0);
14
+ + let [counter, setCounter] = useStore(store);
15
+
16
+ let handleClick = () => {
17
+ setCounter(value => value + 1);
18
+ };
19
+
20
+ return <button onClick={handleClick}>+ {counter}</button>;
21
+ };
22
+ ```
23
+
24
+ 🔹 No boilerplate<br>
25
+ 🔹 Painless transition from local state<br>
26
+ 🔹 SSR- and CSR-compatible
11
27
 
12
28
  Installation: `npm i @t8/react-store`
13
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/react-store",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Concise shared state management for React apps",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",