@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;
|
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
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
-
|
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;IAClF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAC,EAAE;
|
1
|
+
{"version":3,"file":"platformEventsMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/platformEventsMiddleware.tsx"],"names":[],"mappings":";;;AAAA,oDAAoD;AAC7C,MAAM,wBAAwB,GAAG,CAAC,KAAyC,EAAE,EAAE;IAClF,IAAG,OAAO,MAAM,CAAC,gBAAgB,KAAK,UAAU,EAAC;QAC7C,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAC,EAAE;YAC1C,IAAG;gBACC,MAAM,aAAa,GAAG,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;gBACjG,IAAG,aAAa,CAAC,IAAI,KAAK,cAAc,EAAC;oBACrC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;iBACxC;aACJ;YAAC,OAAM,CAAC,EAAC,GAAE;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"}
|