@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.
@@ -1898,6 +1898,7 @@ class HocuspocusProvider extends EventEmitter {
1898
1898
  onMessage: () => null,
1899
1899
  onOutgoingMessage: () => null,
1900
1900
  onSynced: () => null,
1901
+ onStatus: () => null,
1901
1902
  onDisconnect: () => null,
1902
1903
  onClose: () => null,
1903
1904
  onDestroy: () => null,
@@ -1921,10 +1922,11 @@ class HocuspocusProvider extends EventEmitter {
1921
1922
  this.boundPageHide = this.pageHide.bind(this);
1922
1923
  this.boundOnOpen = this.onOpen.bind(this);
1923
1924
  this.boundOnClose = this.onClose.bind(this);
1924
- this.forwardConnect = (e) => this.emit("connect", e);
1925
+ this.forwardConnect = () => this.emit("connect");
1926
+ this.forwardStatus = (e) => this.emit("status", e);
1925
1927
  this.forwardClose = (e) => this.emit("close", e);
1926
1928
  this.forwardDisconnect = (e) => this.emit("disconnect", e);
1927
- this.forwardDestroy = (e) => this.emit("destroy", e);
1929
+ this.forwardDestroy = () => this.emit("destroy");
1928
1930
  this.setConfiguration(configuration);
1929
1931
  this.configuration.document = configuration.document
1930
1932
  ? configuration.document
@@ -2161,6 +2163,8 @@ class HocuspocusProvider extends EventEmitter {
2161
2163
  detach() {
2162
2164
  this.configuration.websocketProvider.off("connect", this.configuration.onConnect);
2163
2165
  this.configuration.websocketProvider.off("connect", this.forwardConnect);
2166
+ this.configuration.websocketProvider.off("status", this.forwardStatus);
2167
+ this.configuration.websocketProvider.off("status", this.configuration.onStatus);
2164
2168
  this.configuration.websocketProvider.off("open", this.boundOnOpen);
2165
2169
  this.configuration.websocketProvider.off("close", this.boundOnClose);
2166
2170
  this.configuration.websocketProvider.off("close", this.configuration.onClose);
@@ -2177,6 +2181,8 @@ class HocuspocusProvider extends EventEmitter {
2177
2181
  return;
2178
2182
  this.configuration.websocketProvider.on("connect", this.configuration.onConnect);
2179
2183
  this.configuration.websocketProvider.on("connect", this.forwardConnect);
2184
+ this.configuration.websocketProvider.on("status", this.configuration.onStatus);
2185
+ this.configuration.websocketProvider.on("status", this.forwardStatus);
2180
2186
  this.configuration.websocketProvider.on("open", this.boundOnOpen);
2181
2187
  this.configuration.websocketProvider.on("close", this.boundOnClose);
2182
2188
  this.configuration.websocketProvider.on("close", this.configuration.onClose);