Last active
July 4, 2018 02:43
-
-
Save toruticas/82867c90d59f61e37482175324737307 to your computer and use it in GitHub Desktop.
[Medium] Example of bad usage of redux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (action, state) => { | |
switch(action.type) { | |
case FIRST_EXAMPLE: | |
return { | |
...state, | |
quickbarIsOpen: true, | |
dfes: { | |
...state.dfes, | |
nfes: { | |
...state.dfes.nfes, | |
data: state.dfes.nfes.data.map((nfe, index) => ({ | |
...nfe, | |
visible: index === action.index, | |
}), | |
}, | |
}, | |
} | |
default: | |
return state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment