UNPKG

wxt-zustand

Version:

High-performance Zustand state management for WXT web extensions with seamless cross-tab synchronization and sub-10ms React re-renders

18 lines 765 B
import { type StateDiff } from '../types'; /** * Validates that a value is a valid state object that can be diffed * @param state - The value to validate * @returns True if the state is a valid object for diffing */ export declare function isValidState(state: unknown): state is Record<string, unknown>; /** * Computes a shallow diff between two state objects * Uses efficient diffing algorithm for optimal state synchronization performance * * @param oldObj - The previous state object * @param newObj - The new state object * @returns Array of changes representing the difference * @throws Error if either state is not a valid object */ export declare function shallowDiff<S>(oldObj: S, newObj: S): StateDiff; //# sourceMappingURL=shallowDiff.d.ts.map