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 store will always be updated. That is because an async function (the getter in this case) will always return a Promise. In this case either the return value of res.json() or a Promise<undefined>. If we instead do this:
Hi, I think you're right. Current docs has a mistake about this. Only explicit undefined will stop store update, but probably we can expand this behavior and cover it with a case of Promise<undefined> as well.
Oh, I found that we already discussed this question with community and actually such behavior was implemented in 1.3.0, but already in 1.3.1 it was rolled back with comment:
If getter wants to keep the current value, it should return undefined in an obvious way.
So, probably, I need to think about it more carefully. I'm not sure I remember the reasons of that. For now, I plan to update README to comply with current behavior, while I thinking about it.
Hi!
I don't known if the docs are wrong or if this is not working as intended, but when running this example:
... the store will always be updated. That is because an async function (the getter in this case) will always return a
Promise
. In this case either the return value ofres.json()
or aPromise<undefined>
. If we instead do this:... it will work as stated in the docs because now the return type is either a
Promise
orundefined
(notPromise<undefined>
).IMO this shouldn't matter. If the getter returns either
undefined
orPromise<undefined>
no update should be triggered.The text was updated successfully, but these errors were encountered: