Scott Beale
Scott Beale
It has been a year with no movement on that svelte PR. Can we open this again?
Okay, figured out an example of how to use this: `{$number(1000, { style: 'currency', currency: 'USD' })}` Number formatters use Intl.NumberFormatOptions. Useful documentation here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat Perhaps a good resolution would...
>You have a store, it is subscribed. Done. But that's not what happens. You have a store, it is subscribed *when the component mounts.* With the current implementation if you...
> I think the best way to deal with this is to conditionally create the store, based on the feature flag. > > One possibility is something like the below...
This problem also crops up in other places, not just when dealing with async data. https://svelte.dev/repl/71951e1141f649958abfb0ee317e025b?version=3.55.0 Here we see that logic that would otherwise work breaks your app when moved...
> TBH I think the proposed solution has its own set of problems. To what length should the compiler go to determine whether a store should be subscribed or not?...
@baseballyama I think you may have misunderstood what is being asked. I am referring to subscriptions that occurs in the template with the $ operator, NOT the tag. That is...
"manage the timing of store initialization is a userland task, not a Svelte task." But that's just it. With the current implementation the user CANT control when a store is...
@dummdidumm You are claiming this adds to much complexity to do automatically, while also claiming this can be easily worked around. That seems like a contradiction to me. > because...
The svelte "module context" tutorials demonstrates a pattern for using a module context to manage components that should be controlled as a group. This is accomplished using `bind:this` to gain...