Represents a store for storing data associated with commands

interface ICliStateStore {
    getState<T extends CliState = CliState>(): T;
    initialize(): Promise<void>;
    persist(): Promise<void>;
    reset(): void;
    select<K>(selector: (state: CliState) => K): Observable<K>;
    subscribe(callback: (state: CliState) => void): Subscription;
    updateState(newState: Partial<CliState>): void;
}

Methods

  • Select a specific property or computed value from the state.

    Type Parameters

    • K

    Parameters

    • selector: (state: CliState) => K

      A function to project a slice of the state.

    Returns Observable<K>

    Observable of the selected value.

  • Subscribe to state changes.

    Parameters

    • callback: (state: CliState) => void

      Callback function to handle state changes.

    Returns Subscription

    Subscription object to manage the subscription.