Interface ReactiveStore<State>

Interface for a store that can be subscribed for changes.

interface ReactiveStore {
    started: boolean;
    close(options?): MaybePromise<void>;
    getState(): State;
    iterator(options?): AsyncIterableIterator<State>;
    start(options?): MaybePromise<void>;
    subscribe(handler, options?): MaybePromise<Unsubscribe>;
}

Type Parameters

  • State = unknown

Hierarchy

Implemented by

Properties

started: boolean

Returns if this has started.

Methods

  • Closes this object and releases any system resource associated with it.

    Parameters

    Returns MaybePromise<void>

  • Returns the current state.

    Returns State

Generated using TypeDoc