0.9.1 • Published 4 years ago
@redux-tools/epics v0.9.1
@redux-tools/epics
A Redux store enhancer for asynchronous injection of epics.
API Reference
makeEnhancer
Function which creates an enhancer to pass to createStore()
.
Arguments
options
(Object):epicMiddleware
(Middleware): Return value ofcreateEpicMiddleware()
. Note that you must mount this middleware yourself (using theapplyMiddleware(epicMiddleware)
enhancer).streamCreator
(Function): Stream creator, the return value of which will be passed as the 3rd argument to all injected epics.
Returns
(Enhancer): A Redux store enhancer which you can pass to createStore()
.
Example
import { createStore, applyMiddleware } from 'redux';
import { createEpicMiddleware } from 'redux-observable';
import { makeEnhancer } from '@redux-tools/epics';
import { identity, compose } from 'ramda';
const epicMiddleware = createEpicMiddleware();
const store = createStore(
identity,
compose(
makeEnhancer({ epicMiddleware }),
applyMiddleware(epicMiddleware)
)
);
store.injectEpics
This function will store passed epics internally and start them if they're not running already.
Arguments
epics
(Object): Epics to inject.options
(Object): Injection options. The following keys are supported:namespace
(string): Namespace to inject the epic under. If passed, the epic will not handle actions from other namespaces and will always include the namespace in all returned actions
store.ejectEpics
Opposite to store.injectEpics
. This function will stop the passed epics. Make sure that you pass the correct namespace and epics (keys AND values), otherwise the epics will not be stopped.
Arguments
epics
(Object): Epics to eject. Make sure that both the keys and values match the injected ones!options
(Object): Ejection options. The following keys are supported:namespace
(string): Namespace the epics were injected under.
0.9.1
4 years ago
0.8.1
4 years ago
0.8.2
4 years ago
0.8.0
4 years ago
0.7.0
4 years ago
0.6.0
5 years ago
0.5.0
5 years ago
0.5.0-alpha.4
5 years ago
0.5.0-alpha.3
5 years ago
0.5.0-alpha.2
5 years ago
0.5.0-alpha.1
5 years ago
0.5.0-alpha.0
5 years ago
0.4.0
5 years ago
0.3.0
5 years ago
0.2.0
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago