gjendje 0.9.2 → 0.9.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.
Files changed (2) hide show
  1. package/README.md +6 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -25,23 +25,23 @@ const theme = state.local({ theme: 'light' })
25
25
  For in-memory state that doesn't persist, use `state` without a scope:
26
26
 
27
27
  ```ts
28
- const filters = state({ role: 'all', status: 'active', tags: [] })
28
+ const user = state({ name: 'John', age: 30 })
29
29
  ```
30
30
 
31
31
  ### Getting values
32
32
 
33
33
  ```ts
34
- const filters = store.get() // Returns the full state object
35
- const { role, status } = store.get() // Get values by destructuring
34
+ user.get() // { name: 'John', age: 30 }
35
+ const { name } = user.get() // Destructure specific values
36
36
  ```
37
37
 
38
38
  ### Updating values
39
39
 
40
- Replace the entire value with `set`, or use an updater function:
40
+ Replace the entire state with `set`, or use an updater function:
41
41
 
42
42
  ```ts
43
- store.set({ counter: 1 })
44
- store.set((prev) => ({ ...prev, counter: prev.counter + 1 }))
43
+ user.set({ name: 'Jane', age: 25 })
44
+ user.set((prev) => ({ ...prev, age: prev.age + 1 }))
45
45
  ```
46
46
 
47
47
  For object stores, `patch` lets you update specific properties without spreading:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gjendje",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Unified storage backend state management, built with TypeScript",
5
5
  "keywords": [
6
6
  "state",