cry-synced-db-client 0.1.16 → 0.1.17

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -335,6 +335,7 @@ class SyncedDb {
335
335
  }
336
336
  if (this.serverUpdateNotifier) {
337
337
  this.unsubscribeServerUpdates = this.serverUpdateNotifier.subscribe((payload) => this.handleServerUpdate(payload));
338
+ await this.serverUpdateNotifier.connect();
338
339
  }
339
340
  if (typeof window !== "undefined") {
340
341
  this.beforeUnloadHandler = () => {
@@ -357,6 +358,9 @@ class SyncedDb {
357
358
  this.unsubscribeServerUpdates();
358
359
  this.unsubscribeServerUpdates = undefined;
359
360
  }
361
+ if (this.serverUpdateNotifier) {
362
+ await this.serverUpdateNotifier.disconnect();
363
+ }
360
364
  if (typeof window !== "undefined" && this.beforeUnloadHandler) {
361
365
  window.removeEventListener("beforeunload", this.beforeUnloadHandler);
362
366
  this.beforeUnloadHandler = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cry-synced-db-client",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",