vivth 1.4.7 → 1.4.8

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/README.md CHANGED
@@ -2591,10 +2591,7 @@ export const myDoubleWorker = WorkerMainThread.newVivthWorker(
2591
2591
 
2592
2592
  ```js
2593
2593
  /**
2594
- * @param {boolean} terminateAllReactivity
2595
- * - false: only terminate `Worker` instance;
2596
- * - true: also terminate `Signal`s and `Effect`s;
2597
- * @return {Promise<void>}
2594
+ * @return {void}
2598
2595
  */
2599
2596
  ```
2600
2597
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vivth",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "library primitives",
5
5
  "main": "index.mjs",
6
6
  "types": "./types/index.d.mts",
@@ -241,7 +241,7 @@ export class WorkerMainThread {
241
241
  if (worker.#worker.value) {
242
242
  worker.#worker.value.postMessage(closeWorkerThreadEventObject, []);
243
243
  }
244
- await worker.terminate(true);
244
+ worker.terminate();
245
245
  });
246
246
  }
247
247
  }
@@ -266,19 +266,13 @@ export class WorkerMainThread {
266
266
  /**
267
267
  * @description
268
268
  * - terminate all signals that are used on this instance;
269
- * @param {boolean} terminateAllReactivity
270
- * - false: only terminate `Worker` instance;
271
- * - true: also terminate `Signal`s and `Effect`s;
272
- * @return {Promise<void>}
269
+ * @return {void}
273
270
  */
274
- terminate = async (terminateAllReactivity) => {
271
+ terminate = () => {
275
272
  /**
276
273
  * this is more for browser, as most of this are automatically cleaned with `SafeExit`;
277
274
  */
278
- await this.#worker.value?.terminate();
279
- if (!terminateAllReactivity) {
280
- return;
281
- }
275
+ this.#worker.value?.terminate();
282
276
  this.#worker.remove.ref();
283
277
  this.#handler.options.removeEffect();
284
278
  this.#proxyPost.remove.ref();
@@ -174,7 +174,7 @@ export class WorkerMainThread {
174
174
  if (worker.#worker.value) {
175
175
  worker.#worker.value.postMessage(closeWorkerThreadEventObject, []);
176
176
  }
177
- await worker.terminate(true);
177
+ await worker.terminate();
178
178
  });
179
179
  }
180
180
  }
@@ -197,17 +197,13 @@ export class WorkerMainThread {
197
197
  worker.postMessage(postData, []);
198
198
  });
199
199
  /**
200
- * @param {boolean} terminateAllReactivity
201
- * @return {Promise<void>}
200
+ * @return {void}
202
201
  */
203
- terminate = async (terminateAllReactivity) => {
202
+ terminate = () => {
204
203
  /**
205
204
  * this is more for browser, as most of this are automatically cleaned with `SafeExit`;
206
205
  */
207
- await this.#worker.value?.terminate();
208
- if (!terminateAllReactivity) {
209
- return;
210
- }
206
+ this.#worker.value?.terminate();
211
207
  this.#worker.remove.ref();
212
208
  this.#handler.options.removeEffect();
213
209
  this.#proxyPost.remove.ref();
@@ -118,12 +118,9 @@ export class WorkerMainThread<WT extends WorkerThread<any, any>> {
118
118
  /**
119
119
  * @description
120
120
  * - terminate all signals that are used on this instance;
121
- * @param {boolean} terminateAllReactivity
122
- * - false: only terminate `Worker` instance;
123
- * - true: also terminate `Signal`s and `Effect`s;
124
- * @return {Promise<void>}
121
+ * @return {void}
125
122
  */
126
- terminate: (terminateAllReactivity: boolean) => Promise<void>;
123
+ terminate: () => void;
127
124
  /**
128
125
  * @description
129
126
  * - result signal of the processed message;
@@ -64,10 +64,9 @@ export class WorkerMainThread<WT extends WorkerThread<any, any>> {
64
64
  */
65
65
  constructor(handler: Parameters<(typeof WorkerMainThread<WT>)["newVivthWorker"]>[0], options?: Parameters<(typeof WorkerMainThread<WT>)["newVivthWorker"]>[1]);
66
66
  /**
67
- * @param {boolean} terminateAllReactivity
68
- * @return {Promise<void>}
67
+ * @return {void}
69
68
  */
70
- terminate: (terminateAllReactivity: boolean) => Promise<void>;
69
+ terminate: () => void;
71
70
  /**
72
71
  * @type {Derived<WorkerResult<WT["POST"]>>}
73
72
  */