Created
December 27, 2018 07:05
-
-
Save nhanco/c0cb6d0f9af1b8f6156c000046fc6e03 to your computer and use it in GitHub Desktop.
perssit bug
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 const toggleConfig = key => ({ type: "TOGGLECONFIG", key }) | |
const initialState = { | |
darkMode: false, | |
element: true, | |
compare: true, | |
god: true, | |
immortal: true, | |
trieu: true, | |
yTuong: true, | |
tangBo: true, | |
thienMa: true, | |
xungKhac: true, | |
tuanKhong: true, | |
quaiThan: true, | |
maTinh: true, | |
quyNhan: true, | |
daoHoa: true, | |
hoaCai: true | |
} | |
export default (state = initialState, action) => { | |
switch (action.type) { | |
case "TOGGLECONFIG": | |
return { | |
...state, | |
key: !state[action.key] | |
} | |
// return !state[action.key] | |
default: | |
return state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment