@reactive-js/disposable
Advanced tools
Comparing version 0.0.21 to 0.0.22
@@ -5,3 +5,3 @@ export declare type DisposableOrTeardown = DisposableLike | (() => void); | ||
add(disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): this; | ||
dispose(): void; | ||
dispose(): boolean; | ||
remove(disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): this; | ||
@@ -17,3 +17,3 @@ } | ||
add(this: DelegatingDisposableLike, disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): any; | ||
dispose(this: DelegatingDisposableLike): void; | ||
dispose(this: DelegatingDisposableLike): boolean; | ||
remove(this: DelegatingDisposableLike, disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): any; | ||
@@ -20,0 +20,0 @@ }; |
@@ -41,3 +41,4 @@ "use strict"; | ||
dispose() { | ||
if (!this.isDisposed) { | ||
const isDisposed = this.isDisposed; | ||
if (!isDisposed) { | ||
this.isDisposed = true; | ||
@@ -50,2 +51,3 @@ let disposable = this.disposables.shift(); | ||
} | ||
return !isDisposed; | ||
} | ||
@@ -88,3 +90,3 @@ remove(...disposables) { | ||
isDisposed: true, | ||
dispose() { }, | ||
dispose() { return false; }, | ||
remove(..._) { | ||
@@ -106,3 +108,3 @@ return _disposed; | ||
dispose() { | ||
this.disposable.dispose(); | ||
return this.disposable.dispose(); | ||
}, | ||
@@ -109,0 +111,0 @@ remove(disposable, ...disposables) { |
@@ -5,3 +5,3 @@ export declare type DisposableOrTeardown = DisposableLike | (() => void); | ||
add(disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): this; | ||
dispose(): void; | ||
dispose(): boolean; | ||
remove(disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): this; | ||
@@ -17,3 +17,3 @@ } | ||
add(this: DelegatingDisposableLike, disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): any; | ||
dispose(this: DelegatingDisposableLike): void; | ||
dispose(this: DelegatingDisposableLike): boolean; | ||
remove(this: DelegatingDisposableLike, disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): any; | ||
@@ -20,0 +20,0 @@ }; |
@@ -39,3 +39,4 @@ const doDispose = (disposable) => { | ||
dispose() { | ||
if (!this.isDisposed) { | ||
const isDisposed = this.isDisposed; | ||
if (!isDisposed) { | ||
this.isDisposed = true; | ||
@@ -48,2 +49,3 @@ let disposable = this.disposables.shift(); | ||
} | ||
return !isDisposed; | ||
} | ||
@@ -86,3 +88,3 @@ remove(...disposables) { | ||
isDisposed: true, | ||
dispose() { }, | ||
dispose() { return false; }, | ||
remove(..._) { | ||
@@ -104,3 +106,3 @@ return _disposed; | ||
dispose() { | ||
this.disposable.dispose(); | ||
return this.disposable.dispose(); | ||
}, | ||
@@ -107,0 +109,0 @@ remove(disposable, ...disposables) { |
@@ -5,3 +5,3 @@ export declare type DisposableOrTeardown = DisposableLike | (() => void); | ||
add(disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): this; | ||
dispose(): void; | ||
dispose(): boolean; | ||
remove(disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): this; | ||
@@ -17,3 +17,3 @@ } | ||
add(this: DelegatingDisposableLike, disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): any; | ||
dispose(this: DelegatingDisposableLike): void; | ||
dispose(this: DelegatingDisposableLike): boolean; | ||
remove(this: DelegatingDisposableLike, disposable: DisposableOrTeardown, ...disposables: DisposableOrTeardown[]): any; | ||
@@ -20,0 +20,0 @@ }; |
{ | ||
"name": "@reactive-js/disposable", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"main": "dist/cjs/index.js", | ||
@@ -65,3 +65,3 @@ "module": "dist/esm5/index.js", | ||
}, | ||
"gitHead": "3457dad433e17a7335b6c9ba083762ea3ad6ef31" | ||
"gitHead": "e248139a5eb2c5dd02315ca5743c934d99320ad3" | ||
} |
@@ -26,3 +26,3 @@ export type DisposableOrTeardown = DisposableLike | (() => void); | ||
*/ | ||
dispose(): void; | ||
dispose(): boolean; | ||
@@ -81,4 +81,5 @@ /** | ||
dispose() { | ||
if (!this.isDisposed) { | ||
dispose(): boolean { | ||
const isDisposed = this.isDisposed; | ||
if (!isDisposed) { | ||
this.isDisposed = true; | ||
@@ -92,2 +93,3 @@ | ||
} | ||
return !isDisposed; | ||
} | ||
@@ -137,3 +139,3 @@ | ||
isDisposed: true, | ||
dispose() {}, | ||
dispose() { return false; }, | ||
remove(..._: DisposableOrTeardown[]) { | ||
@@ -173,4 +175,4 @@ return _disposed; | ||
}, | ||
dispose(this: DelegatingDisposableLike) { | ||
this.disposable.dispose(); | ||
dispose(this: DelegatingDisposableLike): boolean { | ||
return this.disposable.dispose(); | ||
}, | ||
@@ -177,0 +179,0 @@ remove( |
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
435881
36
1227