You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you don’t use [npm](https://www.npmjs.com), you may grab the latest [UMD](https://npmcdn.com/redux-actions@latest/dist) build from [npmcdn](https://npmcdn.com) (either a [development](https://npmcdn.com/redux-actions@latest/dist/redux-actions.js) or a [production](https://npmcdn.com/redux-actions@latest/dist/redux-actions.min.js) build). The UMD build exports a global called `window.ReduxActions` if you add it to your page via a `<script>` tag. We *don’t* recommend UMD builds for any serious application, as most of the libraries complementary to Redux are only available on [npm](https://www.npmjs.com/search?q=redux).
Wraps an action creator so that its return value is the payload of a Flux Standard Action. If no payload creator is passed, or if it's not a function, the identity function is used.
Returns an object mapping action types to action creators. The keys of this object are camel-cased from the keys in `actionsMap` and the string literals of `identityActions`; the values are the action creators.
84
94
85
95
`actionsMap` is an optional object with action types as keys, and whose values **must** be either
@@ -94,7 +104,7 @@ Returns an object mapping action types to action creators. The keys of this obje
Wraps a reducer so that it only handles Flux Standard Actions of a certain type.
127
141
128
142
If a single reducer is passed, it is used to handle both normal actions and failed actions. (A failed action is analogous to a rejected promise.) You can use this form if you know a certain type of action will never fail, like the increment example above.
@@ -142,6 +156,10 @@ The optional third parameter specifies a default or initial state, which is used
142
156
143
157
### `handleActions(reducerMap, ?defaultState)`
144
158
159
+
```js
160
+
import { handleActions } from'redux-actions';
161
+
```
162
+
145
163
Creates multiple reducers using `handleAction()` and combines them into a single reducer that handles multiple actions. Accepts a map where the keys are passed as the first parameter to `handleAction()` (the action type), and the values are passed as the second parameter (either a reducer or reducer map).
146
164
147
165
The optional second parameter specifies a default or initial state, which is used when `undefined` is passed to the reducer.
0 commit comments