All my stores also have a defaultValue property and reset method
Interesting... why?
All my stores also have a defaultValue property and reset method
Interesting... why?
I ended up writing a custom store that "buffers" sets for both a small time interval and ensuring only one async action is in flight (and triggering an extra round of async processing if a set was seen after the last async action was launched).
QueueStore
For me however, things get really interesting with the creation of “custom” stores. The creators of Svelte were/are obviously well aware of the power and flexibility of these stores and have provided a simply interface to adhere to. Basically, any object that implements the “subscribe” method is a store!
Using another reactive statement with $effect we have Svelte automatically handle subscribing and unsubscribing to the store
One thing I considered was abusing a custom store for this kind of thing.