Skip to content

Instantly share code, notes, and snippets.

@alex35mil
Created February 25, 2017 09:28
Show Gist options
  • Save alex35mil/3c893bc7f7352f1a36ed9771bedfd40a to your computer and use it in GitHub Desktop.
Save alex35mil/3c893bc7f7352f1a36ed9771bedfd40a to your computer and use it in GitHub Desktop.
/* 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