@evlop/commons 1.0.164 → 1.0.165

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"platformEventsMiddleware.d.ts","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.tsx"],"names":[],"mappings":"AACA,eAAO,MAAM,wBAAwB;qBAA8B,GAAG,KAAK,IAAI;aAW7D,GAAG,cAAc,GAAG,QACrC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"platformEventsMiddleware.d.ts","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.tsx"],"names":[],"mappings":"AACA,eAAO,MAAM,wBAAwB;qBAA8B,GAAG,KAAK,IAAI;aAa7D,GAAG,cAAc,GAAG,QACrC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -3,15 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.platformEventsMiddleware = void 0;
4
4
  // listen to window message events and pass to redux
5
5
  const platformEventsMiddleware = (store) => {
6
- window.addEventListener('message', (message) => {
7
- try {
8
- const messageObject = typeof message.data === 'string' ? JSON.parse(message.data) : message.data;
9
- if (messageObject.type === 'REDUX_ACTION') {
10
- store.dispatch(messageObject.action);
6
+ if (typeof window.addEventListener === 'function') {
7
+ window.addEventListener('message', (message) => {
8
+ try {
9
+ const messageObject = typeof message.data === 'string' ? JSON.parse(message.data) : message.data;
10
+ if (messageObject.type === 'REDUX_ACTION') {
11
+ store.dispatch(messageObject.action);
12
+ }
11
13
  }
12
- }
13
- catch (e) { }
14
- });
14
+ catch (e) { }
15
+ });
16
+ }
15
17
  return (next) => (action) => next(action);
16
18
  };
17
19
  exports.platformEventsMiddleware = platformEventsMiddleware;
@@ -1 +1 @@
1
- {"version":3,"file":"platformEventsMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.tsx"],"names":[],"mappings":";;;AAAA,oDAAoD;AAC7C,MAAM,wBAAwB,GAAG,CAAC,KAAyC,EAAE,EAAE;I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QAChB,CAAC,CAAC,CAAC;KACN;IAGD,OAAO,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC,CAAC;AAdW,QAAA,wBAAwB,4BAcnC;AAEF,kBAAe,gCAAwB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.164",
3
+ "version": "1.0.165",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {