Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Latest commit

 

History

History
31 lines (19 loc) · 607 Bytes

README.md

File metadata and controls

31 lines (19 loc) · 607 Bytes

Batch

Batch allows you create higher order actions wrapping more than one actions in one. It allow you to have a nice debug of redux dispatches in the Redux DevTools.

Usage

The batch reducer receives the root reducer and returns a new root reducer.

import { enableBatching } from 'reduken'

const rootReducer = combineReducers({
  ...reducers
})

const store = createStore(enableBatching(rootReducer), initialState, middlewares)

Action Creators

interface Action {
  type: string
  payload: object
}

declare function batchActions(type: string, actions: Action[]): object