Created
July 9, 2018 15:02
-
-
Save coreysnyder/af8d9955d67542f2ca125c1626bbbc28 to your computer and use it in GitHub Desktop.
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 function toggleSidebar(){ | |
return { | |
type: TOGGLE_SIDE_NAV, | |
text: "TEST", | |
} | |
} | |
export default function(state = true, action) { | |
console.log('default state', state, action); | |
// Why is action.text == undefined ??? | |
switch (action.type) { | |
case TOGGLE_SIDE_NAV: | |
return Object.assign({}, state, { | |
sideNavOpen: !state.sideNavOpen || false | |
}); | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment