Skip to content

Commit

Permalink
Document data side-effect quirk
Browse files Browse the repository at this point in the history
  • Loading branch information
LorisSigrist committed Mar 25, 2024
1 parent 7082bdf commit ea06cdd
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,13 @@ export async function load({ depends }) {
}
```

There currently is a caveat with this. When switching languages, any side-effects triggererd by `data` changing will be run twice if the data is language dependent. Once with the new language + old data and then with the new language + new data. We're working to fix this.

## Caveats

1. Links in the same Layout Component as `<ParagldieJS>` will not be translated. This will also log a warngin in development.
2. Messages are not reactive. Don't use them in server-side module scope.
3. Sideeffects triggered by `data` changing will be run twice if the data is language dependent.

### Using messages in `+layout.svelte`

Expand Down

0 comments on commit ea06cdd

Please sign in to comment.