We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef92395 commit 56a396eCopy full SHA for 56a396e
packages/svelte/src/internal/client/resource-management/index.js
@@ -6,6 +6,7 @@ import { teardown } from '../reactivity/effects.js';
6
export function dispose(...disposables) {
7
teardown(() => {
8
for (const disposable of disposables) {
9
+ // @ts-ignore Symbol.dispose may or may not exist as far as TypeScript is concerned
10
disposable?.[Symbol.dispose]();
11
}
12
});
@@ -18,6 +19,7 @@ export function dispose(...disposables) {
18
19
* @param {any} value
20
*/
21
export function disposable(value) {
22
23
if (value != null && !value[Symbol.dispose]) {
24
throw new TypeError('Symbol(Symbol.dispose) is not a function');
25
0 commit comments