cross-tab-worker-databus 0.1.1 → 0.1.2
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/CHANGELOG.md +15 -0
- package/dist/centrifuge-session.d.ts +3 -1
- package/dist/centrifuge-session.d.ts.map +1 -1
- package/dist/centrifuge.js +8 -3
- package/dist/centrifuge.js.map +2 -2
- package/dist/centrifuge.shared.worker.js +12 -4
- package/dist/centrifuge.shared.worker.js.map +2 -2
- package/dist/centrifuge.worker.js +7 -2
- package/dist/centrifuge.worker.js.map +2 -2
- package/dist/{chunk-GABYBK7I.js → chunk-53INHVYO.js} +25 -5
- package/dist/chunk-53INHVYO.js.map +7 -0
- package/dist/core/cluster.d.ts.map +1 -1
- package/dist/core/storage-batch.d.ts +2 -0
- package/dist/core/storage-batch.d.ts.map +1 -1
- package/dist/core/trace.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/workers/port-reaper.d.ts +3 -1
- package/dist/workers/port-reaper.d.ts.map +1 -1
- package/docs/architecture.md +2 -0
- package/docs/configuration.md +2 -0
- package/docs/zh/architecture.md +2 -0
- package/docs/zh/configuration.md +2 -0
- package/package.json +1 -1
- package/dist/chunk-GABYBK7I.js.map +0 -7
|
@@ -5033,12 +5033,17 @@ var CentrifugeSession = class {
|
|
|
5033
5033
|
subscription.on("unsubscribed", () => this.subscriptions.delete(topic));
|
|
5034
5034
|
subscription.subscribe();
|
|
5035
5035
|
}
|
|
5036
|
-
/** Unsubscribe from a Centrifuge channel and clean up the local reference.
|
|
5036
|
+
/** Unsubscribe from a Centrifuge channel and clean up the local reference.
|
|
5037
|
+
* Listeners are removed before unsubscribing so a late `unsubscribed` event
|
|
5038
|
+
* cannot delete a subscription that a subsequent `subscribe()` re-added. */
|
|
5037
5039
|
unsubscribe(topic) {
|
|
5038
5040
|
const subscription = this.subscriptions.get(topic) ?? this.client?.getSubscription(topic);
|
|
5039
5041
|
if (!subscription) return;
|
|
5040
|
-
subscription.
|
|
5042
|
+
subscription.removeAllListeners("publication");
|
|
5043
|
+
subscription.removeAllListeners("error");
|
|
5044
|
+
subscription.removeAllListeners("unsubscribed");
|
|
5041
5045
|
this.subscriptions.delete(topic);
|
|
5046
|
+
subscription.unsubscribe();
|
|
5042
5047
|
}
|
|
5043
5048
|
/** Publish a message to the Centrifuge channel. */
|
|
5044
5049
|
publish(topic, data) {
|