UNPKG

redux-modal-tabs

Version:
49 lines (48 loc) 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const constants_1 = require("./constants"); function addModalTab(title, content, open = true, id = undefined) { if (typeof id === 'undefined') { id = Date.now().toString(); } const modalTab = { title, content, id }; return { type: constants_1.ADD_MODAL_TAB, payload: { modalTab, open } }; } exports.addModalTab = addModalTab; function removeModalTab(id) { return { type: constants_1.REMOVE_MODAL_TAB, payload: { id } }; } exports.removeModalTab = removeModalTab; function openModalTab(id) { return { type: constants_1.OPEN_MODAL_TAB, payload: { id } }; } exports.openModalTab = openModalTab; function closeModalTab(id) { return { type: constants_1.CLOSE_MODAL_TAB, payload: { id } }; } exports.closeModalTab = closeModalTab;