react-globo-state 1.1.0 → 1.1.6
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 +35 -3
- package/index.js +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# [React Globo State - gState.](https://npmjs.com/package/react-globo-state)
|
|
2
2
|
|
|
3
|
-
A react state everywhere, easy and smart ... Only one!
|
|
4
|
-
|
|
5
3
|
**React Globo State** by [Dario Passariello](https://dario.passariello.ca) (c)
|
|
6
4
|
|
|
7
5
|
[](https://npmjs.org/package/react-globo-state)
|
|
@@ -12,6 +10,36 @@ A react state everywhere, easy and smart ... Only one!
|
|
|
12
10
|

|
|
13
11
|

|
|
14
12
|
|
|
13
|
+
## 🚀 Ultra-Optimized React State Engine
|
|
14
|
+
|
|
15
|
+
A tiny, blazing-fast state container designed for modern React applications. Built for developers who demand **maximum performance**, **minimal re-renders**, and **predictable reactivity** without the overhead of traditional state managers.
|
|
16
|
+
|
|
17
|
+
### ⚡ Why this package exists
|
|
18
|
+
|
|
19
|
+
React's built-in state works well for small components, but as your app scales, you start battling unnecessary renders, complex memoization, and context bloat. This package delivers a **super-optimized state layer** that updates only what truly needs to update.
|
|
20
|
+
|
|
21
|
+
### 🧠 Key Features
|
|
22
|
+
|
|
23
|
+
- **Granular subscriptions** - Components re-render only when the specific data they use changes.
|
|
24
|
+
- **Reduce useMEmo use** - Help you to architect a better structure of your application avoid tons of useMemo.
|
|
25
|
+
- **Single container** - Only one container for entire state. No more lost states or unless data in memory.
|
|
26
|
+
- **No more imports** - Only one imports and ready to work.
|
|
27
|
+
- **Zero dependencies** - Lightweight and ideal for high-performance apps or micro-frontend.
|
|
28
|
+
- **Immutable-friendly** - Works seamlessly with immutable patterns while staying fast.
|
|
29
|
+
- **Concurrent-mode ready** - Designed for React and future-proofed for modern rendering.
|
|
30
|
+
- **TypeScript first** - Fully typed API for safe, predictable state flows.
|
|
31
|
+
|
|
32
|
+
### 🧩 Perfect for
|
|
33
|
+
|
|
34
|
+
- High-frequency UI updates (dashboards, 3D apps, visualizers)
|
|
35
|
+
- Enterprise-scale applications
|
|
36
|
+
- Performance-critical components
|
|
37
|
+
- Developers who want a simple API with extreme optimization
|
|
38
|
+
|
|
39
|
+
### 🛠️ How it works
|
|
40
|
+
|
|
41
|
+
The engine uses a **subscription-based reactive core** with micro-level diffing. Only the components that depend on changed values re-render. No proxies, no global invalidation, no magic just deterministic, high-performance state management.
|
|
42
|
+
|
|
15
43
|
## install
|
|
16
44
|
|
|
17
45
|
```bash
|
|
@@ -50,7 +78,11 @@ const App = () => {
|
|
|
50
78
|
},[]
|
|
51
79
|
)
|
|
52
80
|
|
|
53
|
-
return <div>
|
|
81
|
+
return <div>
|
|
82
|
+
{
|
|
83
|
+
gState.get("test").myNewReactState // result -> hello world!
|
|
84
|
+
}
|
|
85
|
+
</div>
|
|
54
86
|
|
|
55
87
|
}
|
|
56
88
|
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as n}from"react";const
|
|
1
|
+
import{useState as n}from"react";const t={};Object.defineProperty(globalThis,"globoState",{value:()=>{const[r,l]=n(null);Object.defineProperty(globalThis,"gState",{value:{get:e=>{if(e)return r?.[e]?r[e]:null},set:(e,u)=>{if(!(!e||!u))return t[e]=u,l({...t}),!0},remove:e=>{if(e)return delete t[e],l({...t}),!0},delete:e=>{if(e)return gState.remove(e),!0},deleteAll:()=>(l({}),!0),list:()=>r},configurable:!0,enumerable:!1}),Object.freeze("gState")},configurable:!0,enumerable:!1});Object.freeze("globoState");
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-globo-state",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "A react state everywhere made easy",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"gState",
|
|
7
|
+
"front-end",
|
|
8
|
+
"back-end",
|
|
9
|
+
"framework",
|
|
10
|
+
"useState",
|
|
6
11
|
"react",
|
|
7
12
|
"state",
|
|
8
|
-
"render",
|
|
9
13
|
"global",
|
|
10
14
|
"dario",
|
|
11
15
|
"passariello"
|