New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[discussion] Expose update() and set() to get around forceUpdate() issue #1
Comments
Yeah, One question though, what is the difference between |
From the docs https://svelte.dev/docs#svelte_store
import { writable } from 'svelte/store';
const count = writable(0);
count.subscribe(value => {
console.log(value);
}); // logs '0'
count.set(1); // logs '1'
count.update(n => n + 1); // logs '2' |
I'm implementing this now, but think that Are you against using |
I added the I agree that
Using
When you have I will leave in the I would very much love to figure out a way to detect mutation so that |
Sorry, I couldnt get to this in time. In svelte, That said, after using Thanks again for taking a look! |
Just chanced upon this package, and from the first look it reminded me a lot of svelte stores that I like a lot.
One thing that stood out on
stream_state
wasforceUpdate()
that's required when you mutate an object as opposed to replacing it. Svelte takes the opposite approach -- Dont do$count = newVal
but do$count.update(newVal)
and$count.set(newVal)
.There are 2 paths here
stream_state
to be like svelte that takes advantage of a popular API. I know this might be breaking change but ifstream_state
isnt used by a lot of people, then this might be a good opportunity.update
andset
in addition. Now there'd be 3 ways to do one thing. I prefer having just 1 way for all cases, rather than the 2.Thanks for reading!
The text was updated successfully, but these errors were encountered: