injectEpic

injectEpic() is used to create a Higher-Order Componentsarrow-up-right that will inject the epic into the runtime.

The Epic stays in the runtime after component is unmounted.

Arguments

  1. epic (Epicarrow-up-right): an epic to inject.

Returns

(Function): Higher-Order Componentsarrow-up-right function

Example: Injecting an Epic in the Container Componentarrow-up-right

containers/Blog/index.js

import { injectEpic } from '@react-observatory/inject-epic'
import epic from './epics'
import Blog from './Blog'

const withEpic = injectEpic(epic)

export default withEpic(Blog)

Example: Injecting the Epic with Redux composearrow-up-right into connectedarrow-up-right Component

Last updated