@corpsmap/corpsmap 3.2.77 → 3.2.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,51 +1,55 @@
1
- import v4 from 'uuid/v4';
1
+ import { v4 } from "uuid/v4";
2
2
 
3
3
  export default {
4
- name: 'notifications',
4
+ name: "notifications",
5
5
 
6
- getReducer(){
7
- const initialData = {}
6
+ getReducer() {
7
+ const initialData = {};
8
8
 
9
9
  return (state = initialData, { type, payload }) => {
10
- if(payload && payload.notification){
10
+ if (payload && payload.notification) {
11
11
  const uid = v4();
12
12
  payload.notification.uid = uid;
13
13
  return Object.assign({}, state, {
14
- [uid]: payload.notification
15
- })
14
+ [uid]: payload.notification,
15
+ });
16
16
  }
17
17
 
18
- switch(type){
19
- case 'NOTIFICATIONS_FIRED':
20
- case 'NOTIFICATIONS_DISMISSED':
18
+ switch (type) {
19
+ case "NOTIFICATIONS_FIRED":
20
+ case "NOTIFICATIONS_DISMISSED":
21
21
  return Object.assign({}, state, payload);
22
22
  default:
23
23
  return state;
24
24
  }
25
- }
25
+ };
26
26
  },
27
27
 
28
- doNotificationsFire: (options) => ({ dispatch, store }) => {
29
- const uid = v4();
30
- options.uid = uid;
31
- dispatch({
32
- type: 'NOTIFICATIONS_FIRED',
33
- payload: {
34
- [uid]: options
35
- }
36
- })
37
- },
28
+ doNotificationsFire:
29
+ (options) =>
30
+ ({ dispatch, store }) => {
31
+ const uid = v4();
32
+ options.uid = uid;
33
+ dispatch({
34
+ type: "NOTIFICATIONS_FIRED",
35
+ payload: {
36
+ [uid]: options,
37
+ },
38
+ });
39
+ },
38
40
 
39
- doNotificationsDismiss: (uid) => ({ dispatch, store }) => {
40
- const state = store.selectNotifications();
41
- delete state[uid];
42
- dispatch({
43
- type: 'NOTIFICATIONS_DISMISSED',
44
- payload: state
45
- })
46
- },
41
+ doNotificationsDismiss:
42
+ (uid) =>
43
+ ({ dispatch, store }) => {
44
+ const state = store.selectNotifications();
45
+ delete state[uid];
46
+ dispatch({
47
+ type: "NOTIFICATIONS_DISMISSED",
48
+ payload: state,
49
+ });
50
+ },
47
51
 
48
52
  selectNotifications: (state) => {
49
53
  return state.notifications;
50
- }
51
- }
54
+ },
55
+ };
@@ -1,4 +1,4 @@
1
- import v4 from "uuid/v4";
1
+ import { v4 } from "uuid/v4";
2
2
  import { createSelector } from "redux-bundler";
3
3
 
4
4
  export default {
@@ -23,51 +23,59 @@ export default {
23
23
  };
24
24
  },
25
25
 
26
- doSouthRegionOpen: (options) => ({ dispatch, store }) => {
27
- const children = store.selectSouthRegionChildrenObj();
28
- const uid = v4();
29
- options.uid = uid;
30
- dispatch({
31
- type: "SOUTH_REGION_OPENED",
32
- payload: {
33
- children: { ...children, [uid]: options },
34
- },
35
- });
36
- },
37
- doSouthRegionClose: () => ({ dispatch, store }) => {
38
- dispatch({
39
- type: "SOUTH_REGION_CLOSED",
40
- payload: {
41
- children: {},
42
- },
43
- });
44
- },
26
+ doSouthRegionOpen:
27
+ (options) =>
28
+ ({ dispatch, store }) => {
29
+ const children = store.selectSouthRegionChildrenObj();
30
+ const uid = v4();
31
+ options.uid = uid;
32
+ dispatch({
33
+ type: "SOUTH_REGION_OPENED",
34
+ payload: {
35
+ children: { ...children, [uid]: options },
36
+ },
37
+ });
38
+ },
39
+ doSouthRegionClose:
40
+ () =>
41
+ ({ dispatch, store }) => {
42
+ dispatch({
43
+ type: "SOUTH_REGION_CLOSED",
44
+ payload: {
45
+ children: {},
46
+ },
47
+ });
48
+ },
45
49
 
46
- doSouthRegionCloseTab: (uid) => ({ dispatch, store }) => {
47
- const children = store.selectSouthRegionChildrenObj();
48
- delete children[uid];
49
- dispatch({
50
- type: "SOUTH_REGION_TAB_CLOSED",
51
- payload: {
52
- children: { ...children },
53
- _shouldTryToCloseRegion: true,
54
- },
55
- });
56
- },
50
+ doSouthRegionCloseTab:
51
+ (uid) =>
52
+ ({ dispatch, store }) => {
53
+ const children = store.selectSouthRegionChildrenObj();
54
+ delete children[uid];
55
+ dispatch({
56
+ type: "SOUTH_REGION_TAB_CLOSED",
57
+ payload: {
58
+ children: { ...children },
59
+ _shouldTryToCloseRegion: true,
60
+ },
61
+ });
62
+ },
57
63
 
58
- doSouthRegionTryClose: () => ({ dispatch, store }) => {
59
- dispatch({
60
- type: "SOUTH_REGION_TRY_CLOSE",
61
- payload: { _shouldTryToCloseRegion: false },
62
- });
63
- const children = store.selectSouthRegionChildren();
64
- if (!children.length) store.doSouthRegionClose();
65
- },
64
+ doSouthRegionTryClose:
65
+ () =>
66
+ ({ dispatch, store }) => {
67
+ dispatch({
68
+ type: "SOUTH_REGION_TRY_CLOSE",
69
+ payload: { _shouldTryToCloseRegion: false },
70
+ });
71
+ const children = store.selectSouthRegionChildren();
72
+ if (!children.length) store.doSouthRegionClose();
73
+ },
66
74
 
67
75
  selectSouthRegionChildrenObj: (state) => {
68
76
  return state.southRegion.children;
69
77
  },
70
-
78
+
71
79
  selectSouthRegionChildren: createSelector(
72
80
  "selectSouthRegionChildrenObj",
73
81
  (children) => {
@@ -84,5 +92,4 @@ export default {
84
92
  if (state.southRegion._shouldTryToCloseRegion)
85
93
  return { actionCreator: "doSouthRegionTryClose" };
86
94
  },
87
-
88
95
  };