8000 feat: support `using`, link top-level `using` declarations in components to lifecycle by Rich-Harris · Pull Request #16192 · sveltejs/svelte · GitHub
[go: up one dir, main page]

Skip to content

feat: support using, link top-level using declarations in components to lifecycle #16192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ignore ts errors
  • Loading branch information
Rich-Harris committed Jun 17, 2025
commit 56a396ec1a36d4daf66531e43af987b5e74aa1f8
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { teardown } from '../reactivity/effects.js';
export function dispose(...disposables) {
teardown(() => {
for (const disposable of disposables) {
// @ts-ignore Symbol.dispose may or may not exist as far as TypeScript is concerned
disposable?.[Symbol.dispose]();
}
});
Expand All @@ -18,6 +19,7 @@ export function dispose(...disposables) {
* @param {any} value
*/
export function disposable(value) {
// @ts-ignore Symbol.dispose may or may not exist as far as TypeScript is concerned
if (value != null && !value[Symbol.dispose]) {
throw new TypeError('Symbol(Symbol.dispose) is not a function');
}
Expand Down
0