@axijs/emitter 1.0.0 → 1.0.1

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
@@ -101,12 +101,8 @@ masterSub.unsubscribe();
101
101
 
102
102
  ## API Documentation
103
103
 
104
- For a complete list of classes, interfaces, and methods, please visit the [API Documentation](https://github.com/axijs/tools/tree/main/packages/emitter/docs/api).
105
-
106
- ## License
107
-
108
- MIT
109
- ```
104
+ For a complete list of classes, interfaces,
105
+ and methods, please visit the [API Documentation](https://github.com/axijs/tools/tree/main/packages/emitter/docs/api).
110
106
 
111
107
  ## License
112
108
 
package/dist/index.js CHANGED
@@ -26,11 +26,6 @@ __export(index_exports, {
26
26
  });
27
27
  module.exports = __toCommonJS(index_exports);
28
28
 
29
- // ../ensure/dist/index.mjs
30
- function isFunction(value) {
31
- return typeof value === "function";
32
- }
33
-
34
29
  // src/subscription.ts
35
30
  var Subscription = class {
36
31
  _closed = false;
@@ -55,11 +50,12 @@ var Subscription = class {
55
50
  * @param teardown A function or another Unsubscribable object to be managed.
56
51
  */
57
52
  add(teardown) {
53
+ const isFunction = typeof teardown === "function";
58
54
  if (this._closed) {
59
- isFunction(teardown) ? teardown() : teardown.unsubscribe();
55
+ isFunction ? teardown() : teardown.unsubscribe();
60
56
  return;
61
57
  }
62
- this._teardowns.push(isFunction(teardown) ? teardown : () => teardown.unsubscribe());
58
+ this._teardowns.push(isFunction ? teardown : () => teardown.unsubscribe());
63
59
  }
64
60
  /**
65
61
  * Disposes the resources held by the subscription.
package/dist/index.mjs CHANGED
@@ -1,8 +1,3 @@
1
- // ../ensure/dist/index.mjs
2
- function isFunction(value) {
3
- return typeof value === "function";
4
- }
5
-
6
1
  // src/subscription.ts
7
2
  var Subscription = class {
8
3
  _closed = false;
@@ -27,11 +22,12 @@ var Subscription = class {
27
22
  * @param teardown A function or another Unsubscribable object to be managed.
28
23
  */
29
24
  add(teardown) {
25
+ const isFunction = typeof teardown === "function";
30
26
  if (this._closed) {
31
- isFunction(teardown) ? teardown() : teardown.unsubscribe();
27
+ isFunction ? teardown() : teardown.unsubscribe();
32
28
  return;
33
29
  }
34
- this._teardowns.push(isFunction(teardown) ? teardown : () => teardown.unsubscribe());
30
+ this._teardowns.push(isFunction ? teardown : () => teardown.unsubscribe());
35
31
  }
36
32
  /**
37
33
  * Disposes the resources held by the subscription.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axijs/emitter",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A minimalistic, type-safe library for single-event and state emitting",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/axijs/tools/tree/main/packages/emitter",