SinkContainer

SinkContainer use to keep store and all the sinks within the same scope.

Since SinkFactory is an instance of SinkContainer the API is the same, all the code example will be using SinkFactory for easier understanding the usage.

createStore(SinkConfiguration) => Store

Create sink store, it can take reducers, middlewares and devToolOptions with configuration

interface SinkConfiguration {
  // regular reducers
  reducers: { [key: string]: (state, action) => state },
  // predefined state
  preloadedState: { ...state },
  // additional middlewares
  middlewares: Array<ReduxMiddleware>,
  // use effect trace, default false
  useEffectTrace?: boolean;
  // use effect, default false
  useTrigger?: boolean;
  // required compose function from redux-dev-tool
  devToolOptions: {
    // devTool compose function
    devToolCompose: Function,
    // should devTool disabled
    disabled?: boolean,
    // other devTool properties
    [key: string]: any
  }
}

getSink(SinkClass) => SinkInstance

Get sink from the current container using sink class

getEffectTasks() => Array<Promise>

Get currently running async effects

getStore() => Store

Get underlining redux store from the container

Last updated