react18-global-store
Version:
A simple yet elegant, light weight, react18 global store to replace Zustand for better tree shaking.
14 lines (13 loc) • 404 B
TypeScript
import { Plugin } from "..";
export interface PersistOptions {
/** @defaultValue true */
sync?: boolean;
/** @defaultValue local */
storage?: "local" | "session" | "cookie";
}
/**
* A plugin that persists and syncs RGS store between tabs.
*
* @returns A plugin that persists and syncs a value between tabs.
*/
export declare const persist: <T>(options?: PersistOptions) => Plugin<T>;