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
Hey, thanks for the lib, but I'm confused a lot, since I started using your lib for a bit more complicated cases, so here is the question.
I don't get it :)
Selectors in hooks allow for computed values already.
E.g. const useSomeThing = () => store.use(state => {...}) where {...} is a calculation of the computed value.
Maybe it makes sense for the usage outside of React, but other than that. Are there any benefits? Or is it just selectors under the hood?
And it's also unclear, should you use store.value.use() there or store.value.get() inside these computed callbacks and how come you can use use() when it's not in React runtime context (that's how it's shown in the docs)
Maybe computed somehow allows for equality functions or something like that, so it won't recompute when the equality function returns true not to rerun expensive calculation?
So many unknowns :) A better Kitchen Sink kind of example that uses all the stuff in an idiomatic way would be great if docs aren't covering it call.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, thanks for the lib, but I'm confused a lot, since I started using your lib for a bit more complicated cases, so here is the question.
I don't get it :)
Selectors in hooks allow for computed values already.
E.g.
const useSomeThing = () => store.use(state => {...})where{...}is a calculation of the computed value.Maybe it makes sense for the usage outside of React, but other than that. Are there any benefits? Or is it just selectors under the hood?
And it's also unclear, should you use
store.value.use()there orstore.value.get()inside thesecomputedcallbacks and how come you can useuse()when it's not in React runtime context (that's how it's shown in the docs)Maybe
computedsomehow allows for equality functions or something like that, so it won't recompute when the equality function returnstruenot to rerun expensive calculation?So many unknowns :) A better Kitchen Sink kind of example that uses all the stuff in an idiomatic way would be great if docs aren't covering it call.
Beta Was this translation helpful? Give feedback.
All reactions