applyToNamespaceRoots(middleware)

A higher-order middleware that ensures the provided middleware is applied to any subspace that is a namespace boundary, i.e. explicilty defines a namespace when the subspace is created.

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 a namespace boundary.

Examples

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

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

results matching ""

    No results matching ""