@liveblocks/core 2.18.0 → 2.18.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.
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/version.ts
8
8
  var PKG_NAME = "@liveblocks/core";
9
- var PKG_VERSION = "2.18.0";
9
+ var PKG_VERSION = "2.18.1";
10
10
  var PKG_FORMAT = "esm";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -6611,7 +6611,8 @@ function createRoom(options, config) {
6611
6611
  storageDidLoad: makeEventSource(),
6612
6612
  storageStatus: makeEventSource(),
6613
6613
  ydoc: makeEventSource(),
6614
- comments: makeEventSource()
6614
+ comments: makeEventSource(),
6615
+ roomWillDestroy: makeEventSource()
6615
6616
  };
6616
6617
  const roomId = config.roomId;
6617
6618
  async function createTextMention(userId, mentionId) {
@@ -7516,7 +7517,8 @@ ${Array.from(traces).join("\n\n")}`
7516
7517
  storageDidLoad: eventHub.storageDidLoad.observable,
7517
7518
  storageStatus: eventHub.storageStatus.observable,
7518
7519
  ydoc: eventHub.ydoc.observable,
7519
- comments: eventHub.comments.observable
7520
+ comments: eventHub.comments.observable,
7521
+ roomWillDestroy: eventHub.roomWillDestroy.observable
7520
7522
  };
7521
7523
  async function getThreadsSince(options2) {
7522
7524
  return httpClient.getThreadsSince({
@@ -7710,11 +7712,17 @@ ${Array.from(traces).join("\n\n")}`
7710
7712
  reconnect: () => managedSocket.reconnect(),
7711
7713
  disconnect: () => managedSocket.disconnect(),
7712
7714
  destroy: () => {
7713
- syncSourceForStorage.destroy();
7715
+ const { roomWillDestroy, ...eventsExceptDestroy } = eventHub;
7716
+ for (const source of Object.values(eventsExceptDestroy)) {
7717
+ source[Symbol.dispose]();
7718
+ }
7719
+ eventHub.roomWillDestroy.notify();
7714
7720
  context.yjsProvider?.off("status", yjsStatusDidChange);
7721
+ syncSourceForStorage.destroy();
7715
7722
  syncSourceForYjs.destroy();
7716
7723
  uninstallBgTabSpy();
7717
7724
  managedSocket.destroy();
7725
+ roomWillDestroy[Symbol.dispose]();
7718
7726
  },
7719
7727
  // Presence
7720
7728
  updatePresence,