@tsdotnet/disposable
Version:
A disposable base class and minimal set of interfaces to properly implement an object disposal pattern.
11 lines (10 loc) • 403 B
TypeScript
/*!
* @author electricessence / https://github.com/electricessence/
* @license MIT
*/
import type DisposableAware from './DisposableAware';
export default class ObjectDisposedException extends Error {
readonly objectName: string;
constructor(objectName: string, message?: string);
static throwIfDisposed(disposable: DisposableAware, objectName: string, message?: string): true | never;
}