Type alias ReduxFeatureOptions

ReduxFeatureOptions: {
    React: Partial<{
        createElement: unknown;
    }>;
    decorators?: ReduxFeatureDecorator[];
    reducers?: Reducer<unknown, any> | Record<string, Reducer<unknown, any>> | boolean;
    shareStore?: string | boolean;
    prepare(initialState): Promise<any>;
}

options for redux feature

Type declaration

  • React: Partial<{
        createElement: unknown;
    }>

    The React module.

    This is needed for the redux feature to wrap subapp's component inside the Redux Provider component.

  • Optional decorators?: ReduxFeatureDecorator[]

    add redux decorators to the redux feature.

    decorators: @xarc/react-redux-observable

  • Optional reducers?: Reducer<unknown, any> | Record<string, Reducer<unknown, any>> | boolean

    specify redux reducer or object of named reducers

    • If it's an object, then it should be an object of named reducers
    • If it's true, then the subapp module should export the named reducers as reduxReducers
    • If it's a function, then it's used as the reducer
  • Optional shareStore?: string | boolean

    Configure the redux store to use

    • true - share with an automatically provided global store
    • false - internal private store available to the subapp instance only
    • string - name a store for sharing - other subapps can share the same store using the name
  • prepare:function
    • prepare redux initial state

      Parameters

      • initialState: any

        when SSR sent initialState used, it will be passed. The client prepare can just return {initialState} as is.

      Returns Promise<any>

      Promise<{initialState: any}>