• Use this hook similar to useState hook. The difference is that you need to pass a unique key - unique across the app to make this state accessible to all client components.

    Type Parameters

    • T

    Parameters

    • key: string
    • Optional value: T

    Returns [T, ((val) => void)]

    Example

    const [state, setState] = useZenStore<number>("counter", 1);
    

Generated using TypeDoc