Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/* 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
You can’t perform that action at this time.