applyToChildren(middleware)

A higher-order middleware that ensures the provided middleware is applied to any subspace that is not the root store.

Arguments

  1. middleware (Function): Function that conforms to the Redux middleware API or Redux Subspaces middleware API

Returns

(Function): A Redux Subspace middleware that applies the middleware to any subspace that is not the root store.

Examples

import { createStore } from 'redux'
import { applyMiddleware, applyToChildren } from 'redux-subspace'
import { reducer, middleware } from 'somewhere'

const store = createStore(reducer, applyMiddleware(applyToChildren(middleware)))

results matching ""

    No results matching ""