@reactive-js/disposable
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -17,8 +17,5 @@ "use strict"; | ||
constructor() { | ||
this._isDisposed = false; | ||
this.isDisposed = false; | ||
this.disposables = []; | ||
} | ||
get isDisposed() { | ||
return this._isDisposed; | ||
} | ||
add(...disposables) { | ||
@@ -39,3 +36,3 @@ if (this.isDisposed) { | ||
if (!this.isDisposed) { | ||
this._isDisposed = true; | ||
this.isDisposed = true; | ||
for (const disposable of this.disposables) { | ||
@@ -42,0 +39,0 @@ doDispose(disposable); |
@@ -15,8 +15,5 @@ const doDispose = (disposable) => { | ||
constructor() { | ||
this._isDisposed = false; | ||
this.isDisposed = false; | ||
this.disposables = []; | ||
} | ||
get isDisposed() { | ||
return this._isDisposed; | ||
} | ||
add(...disposables) { | ||
@@ -37,3 +34,3 @@ if (this.isDisposed) { | ||
if (!this.isDisposed) { | ||
this._isDisposed = true; | ||
this.isDisposed = true; | ||
for (const disposable of this.disposables) { | ||
@@ -40,0 +37,0 @@ doDispose(disposable); |
{ | ||
"name": "@reactive-js/disposable", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"main": "dist/cjs/index.js", | ||
@@ -65,3 +65,3 @@ "module": "dist/esm5/index.js", | ||
}, | ||
"gitHead": "8a86dc5efc38fdfe6683765bf2ff3eb14f3820de" | ||
"gitHead": "bb6f825c233fcf3516c7b6ee146d262ac836e5f2" | ||
} |
@@ -55,9 +55,5 @@ export type DisposableOrTeardown = DisposableLike | (() => void); | ||
class DisposableImpl implements DisposableLike { | ||
private _isDisposed = false; | ||
isDisposed = false; | ||
private readonly disposables: Array<DisposableOrTeardown> = []; | ||
get isDisposed(): boolean { | ||
return this._isDisposed; | ||
} | ||
add(...disposables: DisposableOrTeardown[]) { | ||
@@ -78,3 +74,3 @@ if (this.isDisposed) { | ||
if (!this.isDisposed) { | ||
this._isDisposed = true; | ||
this.isDisposed = true; | ||
@@ -168,2 +164,3 @@ for (const disposable of this.disposables) { | ||
private _disposable: DisposableLike = disposed; | ||
get disposable(): DisposableLike { | ||
@@ -170,0 +167,0 @@ return this._disposable; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
345742
550