ReactFire reference docs / useObservable / ObservableStatus
useObservable.ObservableStatus
Name |
---|
T |
• data: T
The most recent value.
If initialData
is passed in, the first value of data
will be the valuea provided in initialData
UNLESS the underlying observable is ready, in which case it will skip initialData
.
• error: undefined
| Error
Any error that may have occurred in the underlying observable
• firstValuePromise: Promise
<void
>
Promise that resolves after first emit from observable
• hasEmitted: boolean
Indicates whether the hook has emitted a value at some point
If initialData
is passed in, this will be true
.
• isComplete: boolean
If this is true
, the hook will be emitting no further items.
• status: "error"
| "loading"
| "success"
The loading status.
loading
: Waiting for the first value from an observableerror
: Something went wrong. CheckObservableStatus.error
for more detailssuccess
: The hook has emitted at least one value
If initialData
is passed in, this will skip loading
and go straight to success
.