state-jet 1.0.2 β 1.0.3
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.
- package/README.md +28 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# π state-jet: Ultra-Lightweight Global State for React
|
|
2
2
|
|
|
3
3
|
A zero-boilerplate, ultra-fast global state management library for React. No context, reducers, or providersβjust simple reactive state.
|
|
4
4
|
|
|
5
|
-
## π Why
|
|
5
|
+
## π Why state-jet?
|
|
6
6
|
- β
**No Context, No Providers** β Works outside React, reducing unnecessary re-renders.
|
|
7
7
|
- β
**Automatic Re-Renders** β Only components using specific state values update.
|
|
8
8
|
- β
**Super Lightweight** β Less than **1KB** minified!
|
|
@@ -12,3 +12,29 @@ A zero-boilerplate, ultra-fast global state management library for React. No con
|
|
|
12
12
|
```bash
|
|
13
13
|
npm install state-jet
|
|
14
14
|
```
|
|
15
|
+
|
|
16
|
+
## Example Usage
|
|
17
|
+
```bash
|
|
18
|
+
import { useStateGlobal } from "state-jet";
|
|
19
|
+
|
|
20
|
+
const counter = useStateGlobal("counter", 0);
|
|
21
|
+
|
|
22
|
+
function Counter() {
|
|
23
|
+
const count = counter.useStore();
|
|
24
|
+
return <button onClick={() => counter.set(count + 1)}>Count: {count}</button>;
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## β‘ Comparison with Zustand
|
|
29
|
+
|
|
30
|
+
|Feature|Redux|Recoil|MobX|Jotai|state-jet|
|
|
31
|
+
|:----|:----|:----|:----|:----|:----|
|
|
32
|
+
|Setup Required|β
Yes|β
Yes|β οΈ Yes|β No|β No|
|
|
33
|
+
|Bundle Size|π Large|π Medium|β‘ Small|β‘ Small|π₯ Ultra-Small (<1KB)|
|
|
34
|
+
|Reactivity|β οΈ Reducers|β
Atoms|β
Proxy-Based|β
Signals|β
Signal-Like|
|
|
35
|
+
|Renders Only Affected|β No|β
Yes|β
Yes|β
Yes|β
Yes|
|
|
36
|
+
|Derived/Computed State|β No|β
Yes|β
Yes|β
Yes|β
Yes|
|
|
37
|
+
|Optimistic Updates|β No|β No|β No|β No|β
Yes|
|
|
38
|
+
|Undo/Redo|β No|β No|β No|β No|β
Yes|
|
|
39
|
+
|WebSocket Multi-Tab Sync|β No|β No|β No|β No|β
Yes|
|
|
40
|
+
|CRDT Conflict Resolution|β No|β No|β No|β No|β
Yes|
|