UNPKG

@stainless-code/persist

Version:

Hydration-aware persistence for any reactive store — zero-dep persistSource core; codecs, backends, cross-tab transport, source + framework hydration adapters ship as opt-in recipes

18 lines (17 loc) • 712 B
import { c as PersistOptions, o as PersistApi } from "../persist-core-B649IGlX.mjs"; //#region src/adapters/sources/valtio.d.ts /** * Persist a valtio proxy. `snapshot` for reads, `Object.assign` for writes, * `subscribe` for change tracking. * * @example * ```ts * import { proxy } from "valtio"; * import { persistProxy } from "@stainless-code/persist/sources/valtio"; * const state = proxy({ count: 0 }); * const persist = persistProxy(state, { name: "count" }); * ``` */ declare function persistProxy<TState extends object, TPersistedState = TState>(proxyObject: TState, options: PersistOptions<TState, TPersistedState>): PersistApi<TState, TPersistedState>; //#endregion export { persistProxy };