sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.21k stars 4.09k forks source link

Svelte 5: Rune to Store and vice versa #12431

Open david-plugge opened 2 months ago

david-plugge commented 2 months ago

Describe the problem

Converting stores to runes ist not trivial If you want to keep the StartStopNotifier functionality. An example would be converting the page store in SvelteKit into a rune.

Describe the proposed solution

Provide a new rune that converts stores to runes and vice versa.

Importance

nice to have

Not-Jayden commented 1 month ago

FYI https://runed.dev/docs/utilities/store

david-plugge commented 1 month ago

Im pretty sure that implementation does not repect the StartStopNotifier. It simply subscribes to the store on creation.

7nik commented 1 month ago

Why do you need to convert stores to runes at all? Stores reactivity still works in Svelte 5 and is even detected as a dependency in $effect.