Skip to main content

useInjectSaga()

function useInjectSaga(options: {
key: string;
saga: Saga;
}): boolean;

A react hook that dynamically injects a saga when the hook is run

Parameters

options

key

string

The key to inject the saga under

saga

Saga

The saga that will be injected

Returns

boolean

flag indicating whether or not the saga has finished injecting

See

SagaInjectionModes for the other possible modes.

Example

function BooksManager() {
useInjectSaga({ key: "books", saga: booksSaga })

return null;
}