forked from mystiq/hydrogen-web
Create interface IDisposable
Co-authored-by: Bruno Windels <brunow@matrix.org>
This commit is contained in:
parent
08ef84d112
commit
a14a8c3a07
1 changed files with 5 additions and 1 deletions
|
@ -15,7 +15,11 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
type Func = () => void;
|
type Func = () => void;
|
||||||
type Disposable = { dispose: Func; [key: string]: any } | Func;
|
export interface IDisposable {
|
||||||
|
dispose(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Disposable = IDisposable | (() => void);
|
||||||
|
|
||||||
function disposeValue(value: Disposable): void {
|
function disposeValue(value: Disposable): void {
|
||||||
if (typeof value === "function") {
|
if (typeof value === "function") {
|
||||||
|
|
Loading…
Reference in a new issue