@canlooks/statio 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.
Files changed (3) hide show
  1. package/README.md +0 -16
  2. package/index.d.ts +5 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -490,22 +490,6 @@ Selectors are also fully typed — the return type is inferred from the selector
490
490
 
491
491
  ---
492
492
 
493
- ## Comparison
494
-
495
- | Feature | Statio | Zustand | Jotai | Redux Toolkit |
496
- |---------|--------|---------|-------|---------------|
497
- | **Class-based stores** | ✅ | ❌ | ❌ | ❌ |
498
- | **Computed properties** | ✅ (via `compute`) | ❌ (needs middleware) | ✅ (atoms) | ✅ (selectors) |
499
- | **Built-in persistence** | ✅ (`storage`) | ✅ (`persist` middleware) | ✅ (`atomWithStorage`) | ❌ (needs middleware) |
500
- | **Selective re-rendering** | ✅ (selector/shallowEqual) | ✅ (selector/shallow) | ✅ (atomic) | ✅ (selectors) |
501
- | **Bundle size** | Tiny | Tiny | Small | Medium |
502
- | **SSR support** | ✅ | ✅ | ✅ | ✅ |
503
- | **Middleware system** | Wrapper pattern | Middleware API | N/A | Middleware API |
504
-
505
- Statio is ideal when you want Zustand-like simplicity but prefer class-based organization, or need built-in computed properties without additional middleware.
506
-
507
- ---
508
-
509
493
  ## License
510
494
 
511
495
  MIT
package/index.d.ts CHANGED
@@ -36,7 +36,11 @@ declare namespace Statio {
36
36
  * createStore
37
37
  */
38
38
 
39
- function createStore<S extends object = any>(factory: StoreFactory<S> | StoreClass<S>): S
39
+ function createStore<S extends object = any>(factory: StoreFactory<S> | StoreClass<S>): {
40
+ (): S
41
+ <K extends keyof S>(...keys: K[]): Pick<S, K>
42
+ <T = S>(selector: (state: S) => T, isEqual?: IsEqual<T>): T
43
+ }
40
44
 
41
45
  /**
42
46
  * ---------------------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canlooks/statio",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "author": "C.CanLiang <canlooks@gmail.com>",
5
5
  "description": "Simple react state manager",
6
6
  "keywords": [