@astral/mobx-query 1.16.0 → 1.16.1

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.
@@ -7,16 +7,17 @@ export class SynchronizationService {
7
7
  var _a;
8
8
  (_a = this.broadcastChannel) === null || _a === void 0 ? void 0 : _a.addEventListener('message', (event) => {
9
9
  var _a, _b;
10
+ const data = JSON.parse(event.data);
10
11
  (_a = this._dataStorageFactory
11
- .getStorage(event.data.dataKeyHash)) === null || _a === void 0 ? void 0 : _a.setData(event.data.data);
12
+ .getStorage(data.dataKeyHash)) === null || _a === void 0 ? void 0 : _a.setData(data.data);
12
13
  (_b = this._statusStorageFactory
13
- .getStorage(event.data.statusKeyHash)) === null || _b === void 0 ? void 0 : _b.setStatues(event.data.statuses);
14
- this._pollingService.restart(event.data.queryKeyHash);
14
+ .getStorage(data.statusKeyHash)) === null || _b === void 0 ? void 0 : _b.setStatues(data.statuses);
15
+ this._pollingService.restart(data.queryKeyHash);
15
16
  });
16
17
  };
17
18
  this.emit = (keys) => {
18
19
  var _a, _b, _c;
19
- (_a = this.broadcastChannel) === null || _a === void 0 ? void 0 : _a.postMessage(Object.assign(Object.assign({}, keys), { data: (_b = this._dataStorageFactory.getStorage(keys.dataKeyHash)) === null || _b === void 0 ? void 0 : _b.data, statuses: (_c = this._statusStorageFactory.getStorage(keys.statusKeyHash)) === null || _c === void 0 ? void 0 : _c.statuses }));
20
+ (_a = this.broadcastChannel) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify(Object.assign(Object.assign({}, keys), { data: (_b = this._dataStorageFactory.getStorage(keys.dataKeyHash)) === null || _b === void 0 ? void 0 : _b.data, statuses: (_c = this._statusStorageFactory.getStorage(keys.statusKeyHash)) === null || _c === void 0 ? void 0 : _c.statuses })));
20
21
  };
21
22
  if (_BroadcastChannel) {
22
23
  this.broadcastChannel = new _BroadcastChannel('@astral/mobx-query');
@@ -10,16 +10,17 @@ class SynchronizationService {
10
10
  var _a;
11
11
  (_a = this.broadcastChannel) === null || _a === void 0 ? void 0 : _a.addEventListener('message', (event) => {
12
12
  var _a, _b;
13
+ const data = JSON.parse(event.data);
13
14
  (_a = this._dataStorageFactory
14
- .getStorage(event.data.dataKeyHash)) === null || _a === void 0 ? void 0 : _a.setData(event.data.data);
15
+ .getStorage(data.dataKeyHash)) === null || _a === void 0 ? void 0 : _a.setData(data.data);
15
16
  (_b = this._statusStorageFactory
16
- .getStorage(event.data.statusKeyHash)) === null || _b === void 0 ? void 0 : _b.setStatues(event.data.statuses);
17
- this._pollingService.restart(event.data.queryKeyHash);
17
+ .getStorage(data.statusKeyHash)) === null || _b === void 0 ? void 0 : _b.setStatues(data.statuses);
18
+ this._pollingService.restart(data.queryKeyHash);
18
19
  });
19
20
  };
20
21
  this.emit = (keys) => {
21
22
  var _a, _b, _c;
22
- (_a = this.broadcastChannel) === null || _a === void 0 ? void 0 : _a.postMessage(Object.assign(Object.assign({}, keys), { data: (_b = this._dataStorageFactory.getStorage(keys.dataKeyHash)) === null || _b === void 0 ? void 0 : _b.data, statuses: (_c = this._statusStorageFactory.getStorage(keys.statusKeyHash)) === null || _c === void 0 ? void 0 : _c.statuses }));
23
+ (_a = this.broadcastChannel) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify(Object.assign(Object.assign({}, keys), { data: (_b = this._dataStorageFactory.getStorage(keys.dataKeyHash)) === null || _b === void 0 ? void 0 : _b.data, statuses: (_c = this._statusStorageFactory.getStorage(keys.statusKeyHash)) === null || _c === void 0 ? void 0 : _c.statuses })));
23
24
  };
24
25
  if (_BroadcastChannel) {
25
26
  this.broadcastChannel = new _BroadcastChannel('@astral/mobx-query');
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "peerDependencies": {
10
10
  "mobx": "^6.0.0"
11
11
  },
12
- "version": "1.16.0",
12
+ "version": "1.16.1",
13
13
  "author": "Astral.Soft",
14
14
  "license": "MIT",
15
15
  "repository": {