Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1015 Bytes

globalActions.md

File metadata and controls

37 lines (25 loc) · 1015 Bytes

globalActions(...actionTypes)

A Redux middleware that ensures the matching action types as will be raised as global actions.

Arguments

  1. actionsTypes (arguments): Strings or Patterns to match against dispatched action types.

Returns

(Function): The middleware.

Examples

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

const store = createStore(reducer, applyMiddleware(globalActions('ACTION_TYPE')))
import { createStore } from 'redux'
import { applyMiddleware, globalActions } from 'redux-subspace'
import reducer from 'somewhere'

const store = createStore(reducer, applyMiddleware(globalActions('ACTION_TYPE_1', 'ACTION_TYPE_2')))
import { createStore } from 'redux'
import { applyMiddleware, globalActions } from 'redux-subspace'
import reducer from 'somewhere'

const store = createStore(reducer, applyMiddleware(globalActions(/ACTION_.*/)))