Skip to content

Instantly share code, notes, and snippets.

@autr
Created March 6, 2024 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save autr/f5735f64ec27eab13588adcf1e4f1d0e to your computer and use it in GitHub Desktop.
Save autr/f5735f64ec27eab13588adcf1e4f1d0e to your computer and use it in GitHub Desktop.
Svelte 5 Explorations
# Svelte 5 Explorations
I have been using Svelte 5 to refactor a creative coding toolkit previously written in Svelte 4.
The major change in coding style is to take full advantage of reactivity in JS classes (ie. .svelte.js files), and move logic out of components into JS clasees, with the component file only handling HTML/CSS rendering of a reactive Svelte object.
To do this, I uses a dual .svelte.js file to each .svelte file, and various base classes to handle singleton patterns with Map.
In doing so, the main unknown has been what pattern to use when syncronising a component's props with the attendant JS object.
Here is an example of that:
```svelte
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment