@storve/core 1.0.0 → 1.0.1
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 +51 -0
- package/package.json +5 -1
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @storve/core
|
|
2
|
+
|
|
3
|
+
> Framework-agnostic reactive store — works in React, Node, tests, or vanilla JS.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@storve/core)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @storve/core
|
|
13
|
+
# or
|
|
14
|
+
pnpm add @storve/core
|
|
15
|
+
# or
|
|
16
|
+
yarn add @storve/core
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { createStore } from '@storve/core'
|
|
23
|
+
|
|
24
|
+
const store = createStore({ count: 0 })
|
|
25
|
+
store.getState().count // 0
|
|
26
|
+
store.setState(s => ({ count: s.count + 1 }))
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Subpath Exports
|
|
30
|
+
|
|
31
|
+
| Import | Use when |
|
|
32
|
+
|--------|----------|
|
|
33
|
+
| `@storve/core` | Core store, `createStore`, `batch`, `compose` |
|
|
34
|
+
| `@storve/core/async` | Async state, `createAsync`, TTL, SWR |
|
|
35
|
+
| `@storve/core/computed` | Derived state with `computed()` |
|
|
36
|
+
| `@storve/core/persist` | Persistence with `withPersist` |
|
|
37
|
+
| `@storve/core/persist/adapters/localStorage` | localStorage adapter |
|
|
38
|
+
| `@storve/core/persist/adapters/sessionStorage` | sessionStorage adapter |
|
|
39
|
+
| `@storve/core/persist/adapters/indexedDB` | IndexedDB adapter |
|
|
40
|
+
| `@storve/core/persist/adapters/memory` | In-memory adapter (SSR/tests) |
|
|
41
|
+
| `@storve/core/signals` | Fine-grained `signal()` reactivity |
|
|
42
|
+
| `@storve/core/devtools` | Time-travel, Undo/Redo with `withDevtools` |
|
|
43
|
+
| `@storve/core/sync` | Cross-tab sync with `withSync` |
|
|
44
|
+
|
|
45
|
+
## Documentation
|
|
46
|
+
|
|
47
|
+
Full docs, API reference, and examples: [GitHub - Nam1001/React-Flux](https://github.com/Nam1001/React-Flux)
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT
|
package/package.json
CHANGED