Introduction to Svelte Actions
Svelte actions are one of the less commonly used features. An action allows you to run a function when an element is added to the DOM. They can greatly simplify your code and allow you to reuse bits of logic. In this post, I’ll give two examples where a Svelte action would be useful and show why an action is the right tool for the job.