Svelte's lifecycle methods can be used anywhere

This page summarizes the projects mentioned and recommended in the original post on

Our great sponsors
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • Scout APM - Less time debugging, more time building
  • OPS - Build and Run Open Source Unikernels
  • svelte-mount

    A library to make detecting mounted state easier in Svelte

    We can also use onMount to make a store that tells you whether a component has finished mounting or not. This code is from the svelte-mount package:

  • Svelte

    Cybernetically enhanced web apps

    I haven't quite wrapped my mind around it, but you can even use afterUpdate in Svelte to replicate React's useEffect hook. See this example from Rich Harris, which I found in an interesting GitHub issue discussing the edges of Svelte's reactivity.

  • SonarLint

    Deliver Cleaner and Safer Code - Right in Your IDE of Choice!. SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.

  • marvel-by-year

    Site to browse Marvel Unlimited by release year. Built with SvelteKit.

    I simplified my implementation of this for the above example, but you can find the original code on GitHub.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts