Interface CoreEngine<State, ExtraArguments, Configuration>

interface CoreEngine<State, ExtraArguments, Configuration> {
    dispatch: EngineDispatch<State & {
        configuration: Configuration;
        version: string;
    } & Partial<SearchParametersState>, ExtraArguments>;
    logger: Logger;
    navigatorContext: NavigatorContext;
    relay: Relay;
    state: State & {
        configuration: Configuration;
        version: string;
    } & Partial<SearchParametersState>;
    store: EnhancedStore<any, UnknownAction, Tuple<[StoreEnhancer<{
        dispatch: {};
    }>, StoreEnhancer]>>;
    addReducers(reducers: {}): void;
    disableAnalytics(): void;
    enableAnalytics(): void;
    subscribe(listener: (() => void)): Unsubscribe;
}

Type Parameters

  • State extends object = {}
  • ExtraArguments extends ThunkExtraArguments = ThunkExtraArguments
  • Configuration extends CoreConfigurationState = CoreConfigurationState

Hierarchy (view full)

Methods

  • Adds the specified reducers to the store.

    Parameters

    • reducers: {}

      An object containing the reducers to attach to the engine.

      Returns void

    • Adds a change listener. It will be called any time an action is dispatched, and some part of the state tree may potentially have changed. You may then access the new state.

      Parameters

      • listener: (() => void)

        A callback to be invoked on every dispatch.

          • (): void
          • Returns void

      Returns Unsubscribe

      A function to remove this change listener.

    Properties

    dispatch: EngineDispatch<State & {
        configuration: Configuration;
        version: string;
    } & Partial<SearchParametersState>, ExtraArguments>

    Dispatches an action directly. This is the only way to trigger a state change. Each headless controller dispatches its own actions.

    An action supported by the headless engine.

    For convenience, the action object that was just dispatched.

    logger: Logger

    The logger instance used by headless.

    navigatorContext: NavigatorContext

    The navigator context (referer, location, UserAgent)

    relay: Relay

    The Relay instance used by Headless.

    state: State & {
        configuration: Configuration;
        version: string;
    } & Partial<SearchParametersState>

    The complete headless state tree.

    store: EnhancedStore<any, UnknownAction, Tuple<[StoreEnhancer<{
        dispatch: {};
    }>, StoreEnhancer]>>

    The redux store.