You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we auto cleanup effects by calling onDestroy in a try { ... } block with an empty catch {} to avoid errors when a melt component is created outside of a .svelte file. This is error-prone, however.
An admittedly hacky, but less error-prone alternative, is to first check if we can safely call onDestroy by calling an $effect with a noop.
Alternative suggestion: Don't rely on $effect.root. If you want to use a builder outside of Svelte components, you can wrap it with $effect.root manually. Maybe we can provide it as a separate helper.
Currently, we auto cleanup effects by calling
onDestroy
in atry { ... }
block with an emptycatch {}
to avoid errors when a melt component is created outside of a .svelte file. This is error-prone, however.An admittedly hacky, but less error-prone alternative, is to first check if we can safely call
onDestroy
by calling an$effect
with a noop.The text was updated successfully, but these errors were encountered: