Describe the bug
When defining a function in a .svelte.ts file that creates and returns a $state object, everything works as expected when using the function in a .svelte file. However, if the same .svelte file contains another $state definition, the reactivity of the $state object from the function breaks.
Reproduction
See the following branch to test:
https://github.com/signalize/svelte-state-issue
Logs
System Info
Severity
annoyance