Closed braebo closed 3 years ago
It sounds like you want derived
: https://svelte.dev/tutorial/derived-stores
In some cases, like the min
and max
of a range value, you can also pass a function that takes the current store value as its input. Demo here: https://svelte.dev/repl/ecb3b08487b54182b58d19c465be6564?version=3.40.3
Ah yes- good idea! This should cover my use case, I'll try it next time I've got the project open. Thanks!
I'm not sure the best way to do this. I tried a few things like using
this
or anon functions and spreads to no avail. Right now I get:And I'm not sure what the best way to consume them elsewhere is. Perhaps:
Any clarification would be much appreciated! Sorry if I'm overlooking the obvious 😅