UNPKG

1.57 kBJavaScriptView Raw
1"use strict";
2
3var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
4
5Object.defineProperty(exports, "__esModule", {
6 value: true
7});
8exports.removeFirstNotificationReduction = exports.addMultipleNotificationsReduction = exports.addOneNotificationReduction = void 0;
9
10var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
11
12var _objectSpread2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectSpread"));
13
14var addOneNotificationReduction = function addOneNotificationReduction(payload) {
15 return function (state) {
16 return (0, _objectSpread2.default)({}, state, {
17 notifications: (0, _toConsumableArray2.default)(state.notifications).concat([payload])
18 });
19 };
20};
21
22exports.addOneNotificationReduction = addOneNotificationReduction;
23
24var addMultipleNotificationsReduction = function addMultipleNotificationsReduction(payload) {
25 return function (state) {
26 return (0, _objectSpread2.default)({}, state, {
27 notifications: (0, _toConsumableArray2.default)(state.notifications).concat((0, _toConsumableArray2.default)(payload))
28 });
29 };
30};
31
32exports.addMultipleNotificationsReduction = addMultipleNotificationsReduction;
33
34var removeFirstNotificationReduction = function removeFirstNotificationReduction() {
35 return function (state) {
36 return (0, _objectSpread2.default)({}, state, {
37 notifications: state.notifications.splice(1)
38 });
39 };
40};
41
42exports.removeFirstNotificationReduction = removeFirstNotificationReduction;
\No newline at end of file