context-scoped-state 0.0.5 → 0.0.7

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 +11 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
- # context-scoped-state
2
-
3
- **State management that respects component boundaries.**
1
+ <div align="center">
2
+ <img src="logo.svg" alt="context-scoped-state logo" width="120" height="120">
3
+ <h1>context-scoped-state</h1>
4
+ <p><strong>State management that respects component boundaries.</strong></p>
5
+ </div>
4
6
 
5
7
  Unlike global state libraries (Redux, Zustand), `context-scoped-state` keeps your state where it belongs — scoped to the component tree that needs it. Each context provider creates an independent store instance, making your components truly reusable and your tests truly isolated.
6
8
 
@@ -30,12 +32,16 @@ pnpm add context-scoped-state
30
32
 
31
33
  > **Peer Dependencies:** React 18+
32
34
 
35
+ ## Try it Online
36
+
37
+ [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/HarshRohila/context-scoped-state/tree/master/examples/playground)
38
+
33
39
  ## Quick Start
34
40
 
35
41
  ### 1. Create Your Store (one file, one export)
36
42
 
37
43
  ```tsx
38
- // stores/counterStore.ts
44
+ // counterStore.ts
39
45
  import { Store, createStoreHook } from 'context-scoped-state';
40
46
 
41
47
  class CounterStore extends Store<{ count: number }> {
@@ -59,7 +65,7 @@ export const useCounterStore = createStoreHook(CounterStore);
59
65
  ### 2. Use in Your App
60
66
 
61
67
  ```tsx
62
- import { useCounterStore } from './stores/counterStore';
68
+ import { useCounterStore } from './counterStore';
63
69
 
64
70
  function Counter() {
65
71
  const counterStore = useCounterStore();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-scoped-state",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {