UNPKG

react-redux-methods

Version:

A lightweight react-redux toolkit for writing strong-typed, minimal code redux boilerplate.

47 lines (46 loc) 1.72 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var _a; Object.defineProperty(exports, "__esModule", { value: true }); exports.notifiersSelectors = exports.notifiersActions = exports.notifiersReducer = exports.notifiersInitialState = void 0; // types var core_1 = require("../../../core"); exports.notifiersInitialState = { toastId: undefined, isShowMessage: false, theme: "colored", variantType: "successTopCenter", messageText: "", autoClose: 3000, hideProgressBar: true, closeOnClick: false, limit: 4, component: undefined, transition: "bounce", clearQueue: false, delay: undefined, closeButton: true, updateToast: false, }; exports.notifiersReducer = (_a = (0, core_1.createReduxMethods)({ initialState: exports.notifiersInitialState, reducers: { toastNotifierShow: function (s, a) { return (__assign(__assign(__assign({}, s), a.payload), { isShowMessage: true })); }, toastNotifierHide: function () { return exports.notifiersInitialState; }, toastNotifierUpdate: function (s, a) { return (__assign(__assign({}, s), a.payload)); }, }, selectionNode: "notifiers", selectors: { getNotifier: function (s) { return s; }, }, }), _a[0]), exports.notifiersActions = _a[1], exports.notifiersSelectors = _a[2];