Created
February 25, 2017 09:28
-
-
Save alex35mil/3c893bc7f7352f1a36ed9771bedfd40a 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
/* interactions/modalToggle.js */ | |
const MODAL_SHOW = 'MODAL_SHOW'; | |
const MODAL_HIDE = 'MODAL_HIDE'; | |
// --- Show modal | |
// Action creator | |
export const showModal = () => ({ type: MODAL_SHOW }); | |
// Action handler | |
export const onModalShow = { | |
[MODAL_SHOW]: state => state.set('isVisible', true), | |
}; | |
// --- Hide modal | |
// Action creator | |
export const hideModal = () => ({ type: MODAL_HIDE }); | |
// Action handler | |
export const onModalHide = { | |
[MODAL_HIDE]: state => state.set('isVisible', false), | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment