This would require static analysis, meaning subscriptions and assignments would only be reactive within the scope of the variable creation
Basically the same limitations as Svelte 3
Correct, personally I never needed reactivity outside components, maybe I just haven't tried it..
But I wanted to build something where I can see the tradeoffs in implementation for myself
Yeah this is missing a key piece which is the "effect" part of signals...basically you need to implement the auto subscription model inside the effect function...if you are interested in a barebone implementation I suggest you this article from @ryansolid.bsky.social
Comments
Basically the same limitations as Svelte 3
But I wanted to build something where I can see the tradeoffs in implementation for myself
https://dev.to/ryansolid/building-a-reactive-library-from-scratch-1i0p
Thanks for the link 🙏
I'll take a look