Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/recipes/reducers/08-ReusingReducerLogic.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function createCounterWithNamedType(counterName = '') {

function createCounterWithNameData(counterName = '') {
return function counter(state = 0, action) {
const {name = action};
const {name} = action;
if(name !== counterName) return state;

switch (action.type) {
Expand Down Expand Up @@ -129,4 +129,4 @@ const rootReducer = combineReducers({
```


These basic patterns allow you to do things like having multiple instances of a smart connected component within the UI, or reuse common logic for generic capabilities such as pagination or sorting.
These basic patterns allow you to do things like having multiple instances of a smart connected component within the UI, or reuse common logic for generic capabilities such as pagination or sorting.