cerebral / overmind

Overmind - Frictionless state management
https://overmindjs.org
MIT License
1.58k stars 95 forks source link

Svelte + Overmind : Function called outside component initialization #532

Open bertrandlalo opened 3 years ago

bertrandlalo commented 3 years ago

Hi !

I'm trying to add an Overmind store in my SvelteKit project and have some troubles reproducing the code example you provide in the documentation (https://overmindjs.org/views/svelte).

The store gets updated correctly (I added some log on actions increase/decrease), but the count in my component is not reactive.

Indeed, when I write the line $: count = $state.count , I get the following error Uncaught (in promise) Error: Function called outside component initialization error-svelte-overmind

Any idea? 🤞

Thanks for your help 🙏