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.removeFirstNotification = exports.addMultipleNotifications = exports.addOneNotification = 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 addOneNotification = function addOneNotification(uiState, notification) {
|
15 | return (0, _objectSpread2.default)({}, uiState, {
|
16 | notifications: (0, _toConsumableArray2.default)(uiState.notifications).concat((0, _toConsumableArray2.default)(notification ? [notification] : []))
|
17 | });
|
18 | };
|
19 |
|
20 | exports.addOneNotification = addOneNotification;
|
21 |
|
22 | var addMultipleNotifications = function addMultipleNotifications(uiState) {
|
23 | var notifications = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
24 | return (0, _objectSpread2.default)({}, uiState, {
|
25 | notifications: (0, _toConsumableArray2.default)(uiState.notifications).concat((0, _toConsumableArray2.default)(notifications))
|
26 | });
|
27 | };
|
28 |
|
29 | exports.addMultipleNotifications = addMultipleNotifications;
|
30 |
|
31 | var removeFirstNotification = function removeFirstNotification(uiState) {
|
32 | return (0, _objectSpread2.default)({}, uiState, {
|
33 | notifications: uiState.notifications.splice(1)
|
34 | });
|
35 | };
|
36 |
|
37 | exports.removeFirstNotification = removeFirstNotification; |
\ | No newline at end of file |