I'm sure the devs had they're reason. Why did they switch the name from mount to $effect, spelling wise, for lifecycle? Couldn't we apply the $ syntax in front of mount? $mount, $beforeUpdate, $afterUpdate
@levicoderman6 ай бұрын
onMount isn't going anywhere, it's still in svelte 5
@user-eg4qz9yc7e6 ай бұрын
@@levicoderman What about $beforeUpdate and $afterUpdate?
@user-eg4qz9yc7e6 ай бұрын
@@levicoderman Does svelte 4 code break inside version 5?
@512anubis6 ай бұрын
@@user-eg4qz9yc7e it's renamed because it does something fundamentally different under the hood. $effect not just for running on mount, but also for reactive effects that cant be derived from other state. beforeUpdate and afterUpdate will be deprecated in svelte 5 and are replaced with $effect.pre as it behaves much better.
@user-eg4qz9yc7e6 ай бұрын
@@512anubis Couldn't they preserve the old names with the new functionality and provide the $ symbol? Instead of onMount we have $onMount