Skip to content

About the new updated from $app/state #14763

Answered by brunnerh
frederikhors asked this question in Q&A
Discussion options

You must be logged in to vote

You can use $effect (and any other rune) in JS/TS files that have .svelte. in the name, e.g. custom.svelte.ts.

import { updated } from '$app/state';

export function watchUpdated() {
  $effect(() => {
    if (updated.current) {
      // do something
    }
  });
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by frederikhors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants