:: krowemoh

Thursday | 09 JAN 2025
Posts Links Other About Now

previous

Svelte Work

2025-01-06
svelte

I'm using the sveltekit-konsta template to do some work and it is quite handy. I added a few things like the icon pack from framework7. I also added pwa functionality which is pretty cool.

I'm having issues with when to use the svelte5 runes like derived and effect. State is straightforward enough but mixing the runes with the konstaui library seem to be a pointless effort. I don't understand enough about either to figure out where the error is coming from. Specifically this is with the search bar and how it searches the data. I think my logic was correct as I put things inside state runes and an effect rune to make the search input and results reactive.

However I think the konstaui search bar works differently as it has an onchange trigger that runs. I removed my own logic and went with the framework's logic.

The other thing I need to make sure I remember is that the form action output can be handled by fetch but it needs a deserialize function that is under apps/form. This is handy as I think I was doing something very kludgy to get it work previously.

I'm a big fan of svelte and I'm starting to realize that I reach for it without thinking. The script, tempalte and style being in one file clicks with me and even the routing structure, as messy as it is is nice.