Skip to main contentredux-mvc

Create Context

createContext

HOC.

Creates a redux-mvc context, making the module’s store available to the children.

createContext(definition: Definition)(Component: ReactComponent)

Usage

Creates a context, runs the module and makes the context available.

const Page = createContext({
module
})(PageLayout)

Parameters

Definition = {
module: ModuleInterface,
persist?: Boolean,
contextId?: String | Symbol
}
  1. module: ModuleInterface

    The module to be executed in the context.

  2. persist?: Boolean

    Persists the store object when unmounted.

    Default: true

  3. contextId?: String | Symbol

    Id where the store object will be persisted.

    Default: Symbol("contextId")

Return value

React Component that is a Provider of the context.