We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49437e1 commit 6bf1f31Copy full SHA for 6bf1f31
reactfire/useObservable/index.ts
@@ -37,10 +37,15 @@ export function useObservable(
37
38
const request = requestCache.getRequest(observable$, observableId);
39
40
- const initialValue =
41
- request.value ||
42
- startWithValue ||
43
- suspendUntilFirst(observable$, observableId);
+ let initialValue;
+
+ if (request.value !== undefined) {
+ initialValue = request.value;
44
+ } else if (startWithValue !== undefined) {
45
+ initialValue = startWithValue;
46
+ } else {
47
+ initialValue = suspendUntilFirst(observable$, observableId);
48
+ }
49
50
const [latestValue, setValue] = React.useState(initialValue);
51
0 commit comments