Closed
Description
Currently ObservableQuery.getCurrentResult()
returns a non-stable object when calling it multiple times. This is because it dynamically calculates the result, regardless of whether the value has actually been emitted or not (for example, its possible to get a loading
state from getCurrentResult
even when notifyOnNetworkStatusChange
is false).
This makes it hostile to use in cases where you need a stable value. Furthermore it doesn't always reflect actual values emitted from the observable. We'd like to change this unpredictablility.
This change will also allow us to simplify our React hooks, such as useQuery
, since it would allow us to use getCurrentResult
with useSyncExternalStore
without the need to track those state values externally.