Skip to content

Latest commit

 

History

History
104 lines (57 loc) · 2.51 KB

useObservable.ObservableStatus.md

File metadata and controls

104 lines (57 loc) · 2.51 KB

ReactFire reference docs / useObservable / ObservableStatus

Interface: ObservableStatus<T>

useObservable.ObservableStatus

Type parameters

Name
T

Table of contents

Properties

Properties

data

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.

Defined in

src/useObservable.ts:55


error

error: undefined | Error

Any error that may have occurred in the underlying observable

Defined in

src/useObservable.ts:59


firstValuePromise

firstValuePromise: Promise<void>

Promise that resolves after first emit from observable

Defined in

src/useObservable.ts:63


hasEmitted

hasEmitted: boolean

Indicates whether the hook has emitted a value at some point

If initialData is passed in, this will be true.

Defined in

src/useObservable.ts:45


isComplete

isComplete: boolean

If this is true, the hook will be emitting no further items.

Defined in

src/useObservable.ts:49


status

status: "error" | "loading" | "success"

The loading status.

  • loading: Waiting for the first value from an observable
  • error: Something went wrong. Check ObservableStatus.error for more details
  • success: The hook has emitted at least one value

If initialData is passed in, this will skip loading and go straight to success.

Defined in

src/useObservable.ts:39