SuperJJ007/papermachine--packages-client-store ↗★ 59

@deepseek-ai/dsh-client-store

无 React 依赖的可观察与快照存储契约,共享 Zustand/Immer 引擎。 适合需在不依赖 React 的情况下发布稳定快照的客户端状态管理场景。

套件
@deepseek-ai/dsh-client-store
相容性
待驗證
Cordis 依賴範圍
workspace:^
版本
0.1.5-rc.2
授權
MIT
最近更新
2026年9月12日

同名套件的其他儲存庫

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗


description: "Observable browser state stores with explicit snapshots, subscriptions, and lifecycle ownership." kind: "package-library"

@deepseek-ai/dsh-client-store

English | 中文

Summary

React-free observable and snapshot-store primitives shared by Client controllers and renderer adapters. The package owns synchronous and animation-frame publication, Immer-backed updates, shallow equality, and optional browser persistence; React hook construction remains in @deepseek-ai/dsh-client-ui-renderer. Use it when Client state must publish stable snapshots without depending on React.

Table of Contents


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.
  • Web-shell build input — the static ESM retains third-party imports for Vite; independent consumers supply its development dependencies (dependency rules).

Dev Note

Working context for maintainers — click to expand

None.

Runtime invariant: No companion is published. The package exports a library engine and creates no process-global state; each store instance is covered by its owning tests.

Persistence merges saved object fields over init() so newly introduced fields keep defaults. Declared transient keys are omitted from serialization and restored from init(), even when older payloads contain them. Owners that persist a projection provide persistence.save(state) and persistence.restore(saved, initial) instead of this default merge and filtering; restore validates the parsed JSON and returns the complete initial state with accepted preferences. Callback failures follow the non-fatal storage-error behavior.