Last active
March 19, 2016 00:25
-
-
Save jurgob/08dd460a9b4d9555766d to your computer and use it in GitHub Desktop.
react utils - actions with utils
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
const createLayoutAction = createUpdateStateAction(‘LAYOUT’); | |
const getLayoutState = getReducerState(store, ‘LAYOUT’) | |
export const toogleEditorExpanded = () => { | |
const isEditorExpanded = !getLayoutState().isEditorExpanded; | |
return updateLayoutState({ | |
isEditorExpanded | |
}) | |
} | |
export const toogleLayoutDirection = () => { | |
const direction = getLayoutState().direction === 'vertical' | |
? 'horizontal' | |
: 'vertical' | |
return createLayoutAction({ | |
direction | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment