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
Setting values in Onyx always takes at least one tick of the event loop and updates subscribers late.
Why this is important
A lot of our code could be made simpler and easier to reason about if we could safely assume that any value written in Onyx will be updated immediately.
Solution
Need to explore a bit, but probably an in-memory cache of some kind. Also need to be careful not to break stuff and to update all our tests appropriately.
The text was updated successfully, but these errors were encountered:
We have an in memory cache already and force the extra tick because keyChanged() used to happen after a call to AsyncStorage.getItem() (or something like that).
Coming from: Expensify/App#8306 (comment)
Problem
Setting values in Onyx always takes at least one tick of the event loop and updates subscribers late.
Why this is important
A lot of our code could be made simpler and easier to reason about if we could safely assume that any value written in Onyx will be updated immediately.
Solution
Need to explore a bit, but probably an in-memory cache of some kind. Also need to be careful not to break stuff and to update all our tests appropriately.
The text was updated successfully, but these errors were encountered: