React Observatory
  • Introduction
  • Motivation
  • Dynamic Injection
    • Reducers
    • Epics
  • API Reference
    • applyAsyncEpics
    • applyAsyncReducers
    • composeReducerCreator
    • createRootEpic
    • injectEpic
    • injectReducer
    • withAction
    • withRouterAction
Powered by GitBook
On this page
  • Arguments
  • Returns
  • Example: Creating a Root Epic
  • ./src/epics
  1. API Reference

createRootEpic

PreviouscomposeReducerCreatorNextinjectEpic

Last updated 6 years ago

A helper for creating a root epic and a stream of epics that enables

Arguments

  1. epic (): takes your root epic and decorates it to support Dynamic Epic Injection.

Returns

(Object): An object with a reference to epic$ stream of all epics, witch is used by and rootEpic, which is required for

Example: Creating a Root Epic

./src/epics

import { createRootEpic } from '@react-observatory/inject-reducer'

const logger = action$ =>
  action$
    .ofType('Up')
    .do(console.log)
    .ignoreElements()

const { epic$, rootEpic } = createRootEpic(logger)

export { epic$, rootEpic }
adding new Epics asynchronously.
Epic
applyAsyncEpics
creating a redux-observable middleware.