Statekit - v2.0.1
    Preparing search index...

    Type Alias Store<TState, TActions>

    type Store<TState extends object, TActions extends object> = {
        actions: TActions;
        get: () => TState;
        set: (stateModifier: StateModifier<TState>) => TState;
        subscribe: (listener: Listener) => Listener;
    }

    Type Parameters

    • TState extends object
    • TActions extends object
    Index

    Properties

    actions: TActions

    Actions that can modify the state of the store.

    get: () => TState

    Returns the current state of the store.

    set: (stateModifier: StateModifier<TState>) => TState

    Sets the state of the store.

    subscribe: (listener: Listener) => Listener

    Subscribes to changes in the state of the store. Returns an unsubscribe function.