You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .subscribe() method has already been added to the library, and it was a great addition as it makes it compatible with the svelte $ syntax using the store contract, but only the getter part of the contract was added, but it would be great also take advantage of the setter's part of the contract.
With a .set() method that behaves exactly like the setter value(), svelte can identify when a store is being assigned a new value with an = sign and uses the .set() method to assign this new value
Before the .set() method:
After the .set() method:
Thanks!
The text was updated successfully, but these errors were encountered:
I made a demo of two other cases where this is compelling for Svelte users. The first is two-way binding a signal to an input primitive, and the second is binding a signal containing an object to a select element, which is a slightly magical convenience in Svelte.
Although I'm a Svelte user and I'd like this feature, I can see having a second way to do the same thing in such a tight library is a significant downside.
With Svelte 5 Runes coming, supporting & maintaining our version of Signals in Svelte is less appealing. However, has @developitmentioned in another comment, anyone can easily add support for our Signals as Svelte stores themselves with the following code:
First of all, thank you for the library!
The .subscribe() method has already been added to the library, and it was a great addition as it makes it compatible with the svelte $ syntax using the store contract, but only the getter part of the contract was added, but it would be great also take advantage of the setter's part of the contract.
With a .set() method that behaves exactly like the setter value(), svelte can identify when a store is being assigned a new value with an = sign and uses the .set() method to assign this new value
Before the .set() method:
After the .set() method:
Thanks!
The text was updated successfully, but these errors were encountered: