import { SNAPSHOT } from '../utils/index.js' export type SnapshotSelector = (state: State) => StateSlice /** * Get a snapshot of the store state. * * @param proxyState The store state. * * @since 0.2.0 */ export function snapshot( proxyState: State, selector: SnapshotSelector = (s) => s as unknown as StateSlice ): StateSlice { return selector((proxyState as any)[SNAPSHOT]) } /** * @deprecated Use `snapshot` instead. Will be removed in the next major version. */ export const getSnapshot = snapshot