Skip to main content

createManager()

function createManager(options: {
key: string;
name: string;
reducer?: Reducer;
saga?: Saga;
}): ComponentType<{
children: ReactNode;
}>;

Creates a "manager" component that will inject the provided reducer and saga when mounted. It only renders its children after both the reducer and saga have been injected. This is the recommended way to use redux-injectors.

Parameters

options

key

string

The key to inject the reducer under

name

string

The name to give the manager that shows up in the react devtools

reducer?

Reducer

The reducer that will be injected

saga?

Saga

The saga that will be injected

Returns

ComponentType<{ children: ReactNode; }>

The manager

Example

const BooksManager = createManager({ name: "BooksManager", key: "books", reducer: booksReducer, saga: booksSaga })