react-state-basis 0.6.0 → 0.6.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 +32 -0
- package/dist/chunk-O2ZOR3L2.mjs +869 -0
- package/dist/chunk-O2ZOR3L2.mjs.map +1 -0
- package/dist/index.js +38 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -855
- package/dist/index.mjs.map +1 -1
- package/dist/integrations/zustand-production.d.mts +3 -0
- package/dist/integrations/zustand-production.d.ts +3 -0
- package/dist/integrations/zustand-production.js +31 -0
- package/dist/integrations/zustand-production.js.map +1 -0
- package/dist/integrations/zustand-production.mjs +6 -0
- package/dist/integrations/zustand-production.mjs.map +1 -0
- package/dist/integrations/zustand.d.mts +6 -0
- package/dist/integrations/zustand.d.ts +6 -0
- package/dist/integrations/zustand.js +887 -0
- package/dist/integrations/zustand.js.map +1 -0
- package/dist/integrations/zustand.mjs +33 -0
- package/dist/integrations/zustand.mjs.map +1 -0
- package/package.json +22 -3
package/README.md
CHANGED
|
@@ -137,6 +137,38 @@ Basis is verified against industry-standard codebases to ensure high-fidelity de
|
|
|
137
137
|
|
|
138
138
|
---
|
|
139
139
|
|
|
140
|
+
## Integrations
|
|
141
|
+
|
|
142
|
+
### Zustand
|
|
143
|
+
|
|
144
|
+
Wrap your store with `basisLogger` to give Basis visibility into external
|
|
145
|
+
store updates. Store signals appear as Σ in the HUD and health report.
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
import { create } from 'zustand';
|
|
149
|
+
import { basisLogger } from 'react-state-basis/zustand';
|
|
150
|
+
|
|
151
|
+
export const useStore = create(
|
|
152
|
+
basisLogger((set) => ({
|
|
153
|
+
theme: 'light',
|
|
154
|
+
toggleTheme: () => set((state) => ({
|
|
155
|
+
theme: state.theme === 'light' ? 'dark' : 'light'
|
|
156
|
+
})),
|
|
157
|
+
}), 'MyStore')
|
|
158
|
+
);
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
This enables detection of **Store Mirroring**, **Store Sync Leaks**, and
|
|
162
|
+
**Global Event Fragmentation** across React and Zustand state simultaneously.
|
|
163
|
+
|
|
164
|
+
[See full Zustand example →](./examples/basis-zustand/)
|
|
165
|
+
|
|
166
|
+
### More integrations coming
|
|
167
|
+
|
|
168
|
+
Planned: XState, React Qery, Redux Toolkit. Community PRs welcome.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
140
172
|
## Performance & Privacy
|
|
141
173
|
|
|
142
174
|
**Development:** <1ms overhead per update cycle, zero heap growth
|