@hocuspocus/provider 3.2.3 → 3.2.4

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.
@@ -1877,6 +1877,7 @@ class HocuspocusProvider extends EventEmitter {
1877
1877
  onMessage: () => null,
1878
1878
  onOutgoingMessage: () => null,
1879
1879
  onSynced: () => null,
1880
+ onStatus: () => null,
1880
1881
  onDisconnect: () => null,
1881
1882
  onClose: () => null,
1882
1883
  onDestroy: () => null,
@@ -1900,10 +1901,11 @@ class HocuspocusProvider extends EventEmitter {
1900
1901
  this.boundPageHide = this.pageHide.bind(this);
1901
1902
  this.boundOnOpen = this.onOpen.bind(this);
1902
1903
  this.boundOnClose = this.onClose.bind(this);
1903
- this.forwardConnect = (e) => this.emit("connect", e);
1904
+ this.forwardConnect = () => this.emit("connect");
1905
+ this.forwardStatus = (e) => this.emit("status", e);
1904
1906
  this.forwardClose = (e) => this.emit("close", e);
1905
1907
  this.forwardDisconnect = (e) => this.emit("disconnect", e);
1906
- this.forwardDestroy = (e) => this.emit("destroy", e);
1908
+ this.forwardDestroy = () => this.emit("destroy");
1907
1909
  this.setConfiguration(configuration);
1908
1910
  this.configuration.document = configuration.document
1909
1911
  ? configuration.document
@@ -2140,6 +2142,8 @@ class HocuspocusProvider extends EventEmitter {
2140
2142
  detach() {
2141
2143
  this.configuration.websocketProvider.off("connect", this.configuration.onConnect);
2142
2144
  this.configuration.websocketProvider.off("connect", this.forwardConnect);
2145
+ this.configuration.websocketProvider.off("status", this.forwardStatus);
2146
+ this.configuration.websocketProvider.off("status", this.configuration.onStatus);
2143
2147
  this.configuration.websocketProvider.off("open", this.boundOnOpen);
2144
2148
  this.configuration.websocketProvider.off("close", this.boundOnClose);
2145
2149
  this.configuration.websocketProvider.off("close", this.configuration.onClose);
@@ -2156,6 +2160,8 @@ class HocuspocusProvider extends EventEmitter {
2156
2160
  return;
2157
2161
  this.configuration.websocketProvider.on("connect", this.configuration.onConnect);
2158
2162
  this.configuration.websocketProvider.on("connect", this.forwardConnect);
2163
+ this.configuration.websocketProvider.on("status", this.configuration.onStatus);
2164
+ this.configuration.websocketProvider.on("status", this.forwardStatus);
2159
2165
  this.configuration.websocketProvider.on("open", this.boundOnOpen);
2160
2166
  this.configuration.websocketProvider.on("close", this.boundOnClose);
2161
2167
  this.configuration.websocketProvider.on("close", this.configuration.onClose);