1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
4 |
|
5 | Object.defineProperty(exports, "__esModule", {
|
6 | value: true
|
7 | });
|
8 | exports.removeFirstNotificationReduction = exports.addMultipleNotificationsReduction = exports.addOneNotificationReduction = void 0;
|
9 |
|
10 | var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
|
11 |
|
12 | var _objectSpread2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectSpread"));
|
13 |
|
14 | var 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 |
|
22 | exports.addOneNotificationReduction = addOneNotificationReduction;
|
23 |
|
24 | var 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 |
|
32 | exports.addMultipleNotificationsReduction = addMultipleNotificationsReduction;
|
33 |
|
34 | var removeFirstNotificationReduction = function removeFirstNotificationReduction() {
|
35 | return function (state) {
|
36 | return (0, _objectSpread2.default)({}, state, {
|
37 | notifications: state.notifications.splice(1)
|
38 | });
|
39 | };
|
40 | };
|
41 |
|
42 | exports.removeFirstNotificationReduction = removeFirstNotificationReduction; |
\ | No newline at end of file |