DEV Community

Discussion on: Tips for writing great Svelte tests

 
d_ir profile image
Daniel Irvine 🏳️‍🌈

Item knows about a remove operation, which means it "knows" that it exists in some kind of container (List or otherwise).

Not saying I know of a better solution or that I wouldn’t write it that way myself... just that I’m a little wary of dispatch and I’d keep my eyes open for opportunities to design it differently.

Thread Thread
 
d_ir profile image
Daniel Irvine 🏳️‍🌈

Another point: unless I’m mistaken, $on is part of the internal Svelte API so if you use it, you have to be prepared to figure out a new solution if/when the maintainers break this one 🤣