@oscarpalmer/timer 0.30.0 → 0.31.0

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/get.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const _function = require('./node_modules/@oscarpalmer/atoms/dist/function.cjs');
5
+ const _function = require('@oscarpalmer/atoms/function');
6
6
 
7
7
  function getCallback(value) {
8
8
  return typeof value === "function" ? value : _function.noop;
package/dist/get.js CHANGED
@@ -1,4 +1,4 @@
1
- import { noop } from './node_modules/@oscarpalmer/atoms/dist/function.js';
1
+ import { noop } from '@oscarpalmer/atoms/function';
2
2
 
3
3
  function getCallback(value) {
4
4
  return typeof value === "function" ? value : noop;
package/dist/timer.cjs CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
+ const _function = require('@oscarpalmer/atoms/function');
6
+
5
7
  class Timer {
6
8
  constructor(type, worker, state, options, start) {
7
9
  this.worker = worker;
@@ -57,6 +59,10 @@ class Timer {
57
59
  */
58
60
  destroy() {
59
61
  this.state.destroyed = true;
62
+ this.options.onAfter = _function.noop;
63
+ this.options.onError = _function.noop;
64
+ this.state.callback = _function.noop;
65
+ this.state.trace = void 0;
60
66
  this.#work("stop");
61
67
  }
62
68
  /**
@@ -207,6 +207,10 @@ class Timer {
207
207
  */
208
208
  destroy() {
209
209
  this.state.destroyed = true;
210
+ this.options.onAfter = noop;
211
+ this.options.onError = noop;
212
+ this.state.callback = noop;
213
+ this.state.trace = undefined;
210
214
  this.#work('stop');
211
215
  }
212
216
  /**
package/dist/timer.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { noop } from '@oscarpalmer/atoms/function';
2
+
1
3
  class Timer {
2
4
  constructor(type, worker, state, options, start) {
3
5
  this.worker = worker;
@@ -53,6 +55,10 @@ class Timer {
53
55
  */
54
56
  destroy() {
55
57
  this.state.destroyed = true;
58
+ this.options.onAfter = noop;
59
+ this.options.onError = noop;
60
+ this.state.callback = noop;
61
+ this.state.trace = void 0;
56
62
  this.#work("stop");
57
63
  }
58
64
  /**
package/dist/when.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const _function = require('./node_modules/@oscarpalmer/atoms/dist/function.cjs');
5
+ const _function = require('@oscarpalmer/atoms/function');
6
6
  const constants = require('./constants.cjs');
7
7
  const get = require('./get.cjs');
8
8
  const models = require('./models.cjs');
package/dist/when.js CHANGED
@@ -1,4 +1,4 @@
1
- import { noop } from './node_modules/@oscarpalmer/atoms/dist/function.js';
1
+ import { noop } from '@oscarpalmer/atoms/function';
2
2
  import { milliseconds, destroyedMessage, startedMessage } from './constants.js';
3
3
  import { getValidNumber } from './get.js';
4
4
  import { TimerTrace } from './models.js';
package/package.json CHANGED
@@ -94,5 +94,5 @@
94
94
  },
95
95
  "type": "module",
96
96
  "types": "types/index.d.cts",
97
- "version": "0.30.0"
97
+ "version": "0.31.0"
98
98
  }
package/src/timer.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import {noop} from '@oscarpalmer/atoms/function';
1
2
  import type {
2
3
  TimerOptions,
3
4
  TimerState,
@@ -79,6 +80,12 @@ export class Timer {
79
80
  destroy(): void {
80
81
  this.state.destroyed = true;
81
82
 
83
+ this.options.onAfter = noop;
84
+ this.options.onError = noop;
85
+
86
+ this.state.callback = noop;
87
+ this.state.trace = undefined;
88
+
82
89
  this.#work('stop');
83
90
  }
84
91
 
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
-
5
- function noop() {
6
- }
7
-
8
- exports.noop = noop;
@@ -1,4 +0,0 @@
1
- function noop() {
2
- }
3
-
4
- export { noop };