mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-08 18:48:18 +01:00
Create interface IDisposable
Co-authored-by: Bruno Windels <brunow@matrix.org>
This commit is contained in:
parent
08ef84d112
commit
a14a8c3a07
@ -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…
x
Reference in New Issue
Block a user