The Redux store the whole state tree of Subscription Manager application. The only way to change the state inside it is to dispatch an action by calling dispatch method or running a specific saga middleware using the dispatch method.

NOTE: Dispatches are not considered part of Ordergroove's public API. Custom development using dispatches is subject to break without notice.

As documented in the API section, the Subscription Manager store is accessible through window.og.smi.store.

interface Store {
    dispatch(action): void;
    getState(): State;
    subscribe(listener): undefined;
}

Methods

  • Parameters

    • action: {
          payload?: any;
          type: string;
      }

      Dispatches an action. This is the only way to trigger a state change.

      • Optional payload?: any
      • type: string

    Returns void

    Example

    `og.smi.store.dispatch({type: '<action>', payload:{<payload info>}})`
    
  • 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 call getState() to read the current state tree inside the callback.

    Parameters

    • listener: CallableFunction

    Returns undefined