@moostjs/event-ws 0.6.35 → 0.6.37

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.cjs CHANGED
@@ -156,6 +156,15 @@ const LOGGER_TITLE = "moost-ws";
156
156
  onInit(moost$1) {
157
157
  this.moost = moost$1;
158
158
  }
159
+ /**
160
+ * Called by `Moost.dispose()` before any `@MoostDispose` hook runs: stops the
161
+ * heartbeat, closes the WebSocket server and every open connection (code
162
+ * `1001`) via {@link MoostWs.close}. Safe when nothing was ever started, and
163
+ * in HTTP-integrated mode too (the shared HTTP server is closed by the HTTP
164
+ * adapter's own `onDispose`).
165
+ */ onDispose() {
166
+ this.close();
167
+ }
159
168
  getProvideRegistry() {
160
169
  return (0, _prostojs_infact.createProvideRegistry)([MoostWs, () => this], ["MoostWs", () => this], [_wooksjs_event_ws.WooksWs, () => this.getWsApp()], ["WooksWs", () => this.getWsApp()]);
161
170
  }
package/dist/index.d.ts CHANGED
@@ -163,6 +163,14 @@ declare class MoostWs implements TMoostAdapter<TWsHandlerMeta> {
163
163
  close(): void;
164
164
  protected moost?: Moost;
165
165
  onInit(moost: Moost): void;
166
+ /**
167
+ * Called by `Moost.dispose()` before any `@MoostDispose` hook runs: stops the
168
+ * heartbeat, closes the WebSocket server and every open connection (code
169
+ * `1001`) via {@link MoostWs.close}. Safe when nothing was ever started, and
170
+ * in HTTP-integrated mode too (the shared HTTP server is closed by the HTTP
171
+ * adapter's own `onDispose`).
172
+ */
173
+ onDispose(): void;
166
174
  getProvideRegistry(): moost.TProvideRegistry;
167
175
  getLogger(): TConsoleBase;
168
176
  bindHandler<T extends object = object>(opts: TMoostAdapterOptions<TWsHandlerMeta, T>): void;
package/dist/index.mjs CHANGED
@@ -155,6 +155,15 @@ const LOGGER_TITLE = "moost-ws";
155
155
  onInit(moost) {
156
156
  this.moost = moost;
157
157
  }
158
+ /**
159
+ * Called by `Moost.dispose()` before any `@MoostDispose` hook runs: stops the
160
+ * heartbeat, closes the WebSocket server and every open connection (code
161
+ * `1001`) via {@link MoostWs.close}. Safe when nothing was ever started, and
162
+ * in HTTP-integrated mode too (the shared HTTP server is closed by the HTTP
163
+ * adapter's own `onDispose`).
164
+ */ onDispose() {
165
+ this.close();
166
+ }
158
167
  getProvideRegistry() {
159
168
  return createProvideRegistry([MoostWs, () => this], ["MoostWs", () => this], [WooksWs$1, () => this.getWsApp()], ["WooksWs", () => this.getWsApp()]);
160
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moostjs/event-ws",
3
- "version": "0.6.35",
3
+ "version": "0.6.37",
4
4
  "description": "@moostjs/event-ws",
5
5
  "keywords": [
6
6
  "composables",
@@ -39,15 +39,15 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@wooksjs/event-ws": "^0.7.22"
42
+ "@wooksjs/event-ws": "^0.7.23"
43
43
  },
44
44
  "devDependencies": {
45
45
  "vitest": "3.2.7"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@prostojs/infact": "^0.5.0",
49
- "@wooksjs/event-core": "^0.7.22",
50
- "moost": "^0.6.35"
49
+ "@wooksjs/event-core": "^0.7.23",
50
+ "moost": "^0.6.37"
51
51
  },
52
52
  "scripts": {
53
53
  "pub": "pnpm publish --access public",