@reactive-js/disposable
Advanced tools
Comparing version 0.0.30 to 0.0.31
@@ -11,10 +11,8 @@ export interface ErrorLike { | ||
export declare const disposed: DisposableLike; | ||
export declare const disposableMixin: { | ||
add<This extends DisposableLike>(this: { | ||
disposable: DisposableLike; | ||
} & This, disposable: DisposableLike | ((error?: ErrorLike | undefined) => void)): This; | ||
dispose(this: { | ||
disposable: DisposableLike; | ||
}, error?: ErrorLike | undefined): void; | ||
}; | ||
export declare function add<This extends DisposableLike>(this: { | ||
disposable: DisposableLike; | ||
} & This, disposable: DisposableLike | ((error?: ErrorLike) => void)): This; | ||
export declare function dispose(this: { | ||
disposable: DisposableLike; | ||
}, error?: ErrorLike): void; | ||
export interface SerialDisposableLike extends DisposableLike { | ||
@@ -21,0 +19,0 @@ inner: DisposableLike; |
@@ -68,17 +68,18 @@ "use strict"; | ||
exports.disposed = _disposed; | ||
exports.disposableMixin = { | ||
add(disposable) { | ||
this.disposable.add(disposable); | ||
return this; | ||
}, | ||
dispose(error) { | ||
this.disposable.dispose(error); | ||
}, | ||
}; | ||
function add(disposable) { | ||
this.disposable.add(disposable); | ||
return this; | ||
} | ||
exports.add = add; | ||
function dispose(error) { | ||
this.disposable.dispose(error); | ||
} | ||
exports.dispose = dispose; | ||
class SerialDisposableImpl { | ||
constructor() { | ||
this._inner = exports.disposed; | ||
this.add = exports.disposableMixin.add; | ||
this.disposable = exports.createDisposable(); | ||
this.dispose = exports.disposableMixin.dispose; | ||
this.add = add; | ||
this.disposable = exports.createDisposable(() => { this.isDisposed = true; }); | ||
this.dispose = dispose; | ||
this.isDisposed = false; | ||
} | ||
@@ -101,7 +102,4 @@ get inner() { | ||
} | ||
get isDisposed() { | ||
return this.disposable.isDisposed; | ||
} | ||
} | ||
exports.createSerialDisposable = () => new SerialDisposableImpl(); | ||
//# sourceMappingURL=index.js.map |
@@ -11,10 +11,8 @@ export interface ErrorLike { | ||
export declare const disposed: DisposableLike; | ||
export declare const disposableMixin: { | ||
add<This extends DisposableLike>(this: { | ||
disposable: DisposableLike; | ||
} & This, disposable: DisposableLike | ((error?: ErrorLike | undefined) => void)): This; | ||
dispose(this: { | ||
disposable: DisposableLike; | ||
}, error?: ErrorLike | undefined): void; | ||
}; | ||
export declare function add<This extends DisposableLike>(this: { | ||
disposable: DisposableLike; | ||
} & This, disposable: DisposableLike | ((error?: ErrorLike) => void)): This; | ||
export declare function dispose(this: { | ||
disposable: DisposableLike; | ||
}, error?: ErrorLike): void; | ||
export interface SerialDisposableLike extends DisposableLike { | ||
@@ -21,0 +19,0 @@ inner: DisposableLike; |
@@ -66,17 +66,16 @@ const doDispose = (disposable, error) => { | ||
export const disposed = _disposed; | ||
export const disposableMixin = { | ||
add(disposable) { | ||
this.disposable.add(disposable); | ||
return this; | ||
}, | ||
dispose(error) { | ||
this.disposable.dispose(error); | ||
}, | ||
}; | ||
export function add(disposable) { | ||
this.disposable.add(disposable); | ||
return this; | ||
} | ||
export function dispose(error) { | ||
this.disposable.dispose(error); | ||
} | ||
class SerialDisposableImpl { | ||
constructor() { | ||
this._inner = disposed; | ||
this.add = disposableMixin.add; | ||
this.disposable = createDisposable(); | ||
this.dispose = disposableMixin.dispose; | ||
this.add = add; | ||
this.disposable = createDisposable(() => { this.isDisposed = true; }); | ||
this.dispose = dispose; | ||
this.isDisposed = false; | ||
} | ||
@@ -99,7 +98,4 @@ get inner() { | ||
} | ||
get isDisposed() { | ||
return this.disposable.isDisposed; | ||
} | ||
} | ||
export const createSerialDisposable = () => new SerialDisposableImpl(); | ||
//# sourceMappingURL=index.js.map |
@@ -11,10 +11,8 @@ export interface ErrorLike { | ||
export declare const disposed: DisposableLike; | ||
export declare const disposableMixin: { | ||
add<This extends DisposableLike>(this: { | ||
disposable: DisposableLike; | ||
} & This, disposable: DisposableLike | ((error?: ErrorLike | undefined) => void)): This; | ||
dispose(this: { | ||
disposable: DisposableLike; | ||
}, error?: ErrorLike | undefined): void; | ||
}; | ||
export declare function add<This extends DisposableLike>(this: { | ||
disposable: DisposableLike; | ||
} & This, disposable: DisposableLike | ((error?: ErrorLike) => void)): This; | ||
export declare function dispose(this: { | ||
disposable: DisposableLike; | ||
}, error?: ErrorLike): void; | ||
export interface SerialDisposableLike extends DisposableLike { | ||
@@ -21,0 +19,0 @@ inner: DisposableLike; |
{ | ||
"name": "@reactive-js/disposable", | ||
"version": "0.0.30", | ||
"version": "0.0.31", | ||
"main": "dist/cjs/index.js", | ||
@@ -65,3 +65,3 @@ "module": "dist/esm5/index.js", | ||
}, | ||
"gitHead": "f231e2dd36697e368790180dddb4eb16eb713856" | ||
"gitHead": "c950e60d18f5bb13f5890123c05728b4edf9c3c0" | ||
} |
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
17315
260