You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`scopeName` defaults to `"_global"`. Internally, keys are stored as `${scope}//${key}`. The `.getAll()` method returns a nested object: `{ [scope]: { [key]: value } }`.
529
529
530
530
531
-
## 🧩 Scoping Rules Deep Dive
531
+
## Scoping Rules Deep Dive
532
532
Resolution order used inside hooks:
533
533
1. Explicit 3rd parameter (`scopeName`)
534
534
2. Nearest `SharedStatesProvider` above the component
@@ -539,7 +539,7 @@ Unnamed providers auto‑generate a random scope name: each mount = isolated isl
539
539
Two providers sharing the same `scopeName` act as a single logical scope even if they are disjoint in the tree (great for portals / microfrontends).
| Setup | Install & call hook | Slice + store config | Create store function |
@@ -551,7 +551,7 @@ Two providers sharing the same `scopeName` act as a single logical scope even if
551
551
| Learning curve | Minutes | Higher | Low |
552
552
553
553
554
-
## 🧪 Testing Tips
554
+
## Testing Tips
555
555
* Use static APIs to assert state after component interactions.
556
556
*`sharedStatesApi.clearAll(false, true)`, `sharedFunctionsApi.clearAll(false, true)`, `sharedSubscriptionsApi.clearAll(false, true)` in `afterEach` to isolate tests and clear static states.
@@ -611,7 +611,7 @@ Wrap children; optional `scopeName` (string). If omitted a random unique one is
611
611
612
612
613
613
614
-
## 🤝 Contributions
614
+
## Contributions
615
615
616
616
We welcome contributions!
617
617
If you'd like to improve `react-shared-states`,
@@ -631,18 +631,4 @@ feel free to [open an issue](https://github.com/HichemTab-tech/react-shared-stat
631
631
Inspired by React's built-in primitives and the ergonomics of modern lightweight state libraries.
632
632
Thanks to early adopters for feedback.
633
633
If you'd like to improve `react-shared-states`,
634
-
feel free to [open an issue](https://github.com/HichemTab-tech/react-shared-states/issues) or [submit a pull request](https://github.com/HichemTab-tech/react-shared-states/pulls).
Inspired by React's built-in primitives and the ergonomics of modern lightweight state libraries.
648
-
Thanks to early adopters for feedback.
634
+
feel free to [open an issue](https://github.com/HichemTab-tech/react-shared-states/issues) or [submit a pull request](https://github.com/HichemTab-tech/react-shared-states/pulls).
0 commit comments