Statekit - v2.0.1
    Preparing search index...

    Type Alias StoreOptions<TState>

    type StoreOptions<TState extends object> = {
        onAttach?: StoreEventHandler<TState>;
        onDetach?: StoreEventHandler<TState>;
        onLoad?: StoreEventHandler<TState>;
        onStateChange?: StoreEventHandler<TState>;
        resetOnDetach?: boolean;
    }

    Type Parameters

    • TState extends object
    Index

    Properties

    Invoked when the store is subscribed to.

    Invoked when the store is unsubscribed from.

    Invoked when the store is created.

    onStateChange?: StoreEventHandler<TState>

    Invoked whenever the state changes.

    resetOnDetach?: boolean

    Whether to reset the state to the initial state when the store is detached.