KeepLost/harniverse--packages-client-store ↗★ 1
@deepseek-ai/dsh-client-store
无React依赖的可观察与快照存储契约及共享引擎。 适合需要框架中立状态管理的客户端开发者,支持会话级实例。
同名包的其他仓库
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗@deepseek-ai/dsh-client-store
English | 中文
React-free observable and snapshot-store primitives shared by Client controllers and renderer adapters. The package owns the framework-neutral store contracts (StoreSpec/StoreHandle/BakedActions, plus StorePersistence for validated projections) and the engine behind them: createSnapshotStore (zustand vanilla + subscribeWithSelector + Immer produce updates + dev freeze) with synchronous or animation-frame-batched publication, shallowEqual, and defineStore, which bakes an init/persist/actions literal into a handle whose create(scopeKey?) yields per-session or root-scope instances with draft-stripped actions and clearPersisted cleanup. Optional persist accepts either a whole-state key or a StorePersistence with select/restore. Engine products are bare observables — getSnapshot/subscribe/update/set, no selector hook; hook synthesis stays in web-react, which binds useStore from these sources at the binding site. ui-slots re-exports the slot-facing contract types; the runtime package re-exports the engine values for existing importers.
Model Experience
None, as this package provides browser-side state primitives and registers nothing model-facing.
KV Cache effect
None; the stores neither assemble nor send model requests.
Known Limitations and Deferred Work
- Persistence is browser-local — persisted stores use JSON in
localStorage; non-browser runtimes disable persistence, and the package provides no cross-device synchronization. - The persist key is the storage identity — multiple live instances created under the same resolved key share (and cross-pollute) one
localStorageentry; instance uniqueness per key is the caller's responsibility (the framework caches one instance per handle × scope key).