opus-codec-worker 0.0.34 → 0.0.35

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.
@@ -4,5 +4,7 @@ export default class Client {
4
4
  constructor(worker: Worker);
5
5
  close(): void;
6
6
  sendMessage<T extends IWorkerRequest<unknown, unknown>>(data: T): Promise<RequestResponse<RequestResponseType<T>>>;
7
+ private onMessageError;
8
+ private onError;
7
9
  private onMessage;
8
10
  }
package/actions/Client.js CHANGED
@@ -13,6 +13,8 @@ class Client {
13
13
  constructor(worker) {
14
14
  this.#worker = worker;
15
15
  worker.addEventListener('message', this.onMessage);
16
+ worker.addEventListener('messageerror', this.onMessageError);
17
+ worker.addEventListener('error', this.onError);
16
18
  }
17
19
  close() {
18
20
  this.#worker.terminate();
@@ -46,6 +48,12 @@ class Client {
46
48
  this.#worker.postMessage(data);
47
49
  });
48
50
  }
51
+ onMessageError(e) {
52
+ console.error(e);
53
+ }
54
+ onError(e) {
55
+ console.error(e);
56
+ }
49
57
  onMessage(e) {
50
58
  const data = e.data;
51
59
  const request = this.#pending.get(data.requestId);
@@ -56,6 +64,12 @@ class Client {
56
64
  request(data);
57
65
  }
58
66
  }
67
+ __decorate([
68
+ autobind_decorator_1.boundMethod
69
+ ], Client.prototype, "onMessageError", null);
70
+ __decorate([
71
+ autobind_decorator_1.boundMethod
72
+ ], Client.prototype, "onError", null);
59
73
  __decorate([
60
74
  autobind_decorator_1.boundMethod
61
75
  ], Client.prototype, "onMessage", null);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opus-codec-worker",
3
3
  "license": "MIT",
4
- "version": "0.0.34",
4
+ "version": "0.0.35",
5
5
  "files": [
6
6
  "**/*.{js,d.ts,map}"
7
7
  ]