valdres 1.0.0-beta.8 → 1.0.0-beta.9
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 +28 -1
- package/dist/index.js +589 -179
- package/dist/types/errors/SchemaValidationError.d.ts +14 -0
- package/dist/types/index.d.ts +10 -3
- package/dist/types/lib/createStoreData.d.ts +4 -0
- package/dist/types/lib/onCommitEnd.d.ts +35 -0
- package/dist/types/lib/registerName.d.ts +12 -0
- package/dist/types/lib/reportAsyncSchemaError.d.ts +16 -0
- package/dist/types/lib/transaction.d.ts +1 -1
- package/dist/types/lib/valdresGlobal.d.ts +24 -0
- package/dist/types/lib/validateResolvedValue.d.ts +19 -0
- package/dist/types/lib/validateSchema.d.ts +27 -0
- package/dist/types/lib/wireCodec.d.ts +24 -0
- package/dist/types/types/Atom.d.ts +4 -0
- package/dist/types/types/AtomFamily.d.ts +6 -0
- package/dist/types/types/AtomOptions.d.ts +11 -0
- package/dist/types/types/DehydratedState.d.ts +32 -0
- package/dist/types/types/InitializeCallback.d.ts +12 -0
- package/dist/types/types/Schema.d.ts +27 -0
- package/dist/types/types/Selector.d.ts +4 -0
- package/dist/types/types/SelectorFamily.d.ts +7 -0
- package/dist/types/types/SelectorOptions.d.ts +11 -0
- package/dist/types/types/StandardSchemaV1.d.ts +39 -0
- package/dist/types/types/Store.d.ts +21 -0
- package/dist/types/types/StoreData.d.ts +12 -0
- package/dist/types/utils/applyInitialize.d.ts +25 -0
- package/dist/types/utils/dehydrate.d.ts +37 -0
- package/dist/types/utils/hydrate.d.ts +49 -0
- package/dist/types/utils/setAtomPairs.d.ts +21 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- DOCS:START -->
|
|
2
|
+
|
|
3
|
+
# valdres
|
|
4
|
+
|
|
5
|
+
Fast atom-based state management for JavaScript. Inspired by Recoil and Jotai.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install valdres
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { store, atom, selector } from "valdres"
|
|
15
|
+
|
|
16
|
+
const countAtom = atom(0)
|
|
17
|
+
const doubledSelector = selector(get => get(countAtom) * 2)
|
|
18
|
+
|
|
19
|
+
const s = store()
|
|
20
|
+
s.set(countAtom, 21)
|
|
21
|
+
s.get(doubledSelector) // 42
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Part of [Valdres](https://valdres.dev) — reactive state management for React, Vue, Svelte, Solid, and Angular.
|
|
25
|
+
|
|
26
|
+
Full documentation: https://valdres.dev/guides/introduction
|
|
27
|
+
|
|
28
|
+
<!-- DOCS:END -->
|