Skip to main content

Interface: SnapshotEmitter<ReturnType>

Type parameters

Name
ReturnType

Implemented by

Methods

paginate

paginate(options?): Pagination<ReturnType>

Returns a pagination wrapper for this query.

Parameters

NameTypeDescription
options?Partial<PaginationOptions>The pagination options. Defaults to { subscribe: true, pageSize: 100 }.

Returns

Pagination<ReturnType>


peek

peek(): ReturnType[]

Returns the results of the query based on the data that is currently available on the client. This method is useful for synchronously accessing data that has already been fetched by another query. The method will return an empty array if data has not yet been populated.

Returns

ReturnType[]

An array of query results.


serialize

serialize(): SerializedQuery

Returns

SerializedQuery


snapshot

snapshot(): Promise<ReturnType[]>

Returns a promise that resolves to the query results.

Returns

Promise<ReturnType[]>

A promise that resolves to the query results.


snapshots

snapshots(subscribe?): Observable<ReturnType[]>

Returns an observable that emits the query results and updates whenever the query results change unless subscribe=false is provided.

Important: Make sure to unsubscribe from the observable when you are done with it.

Parameters

NameTypeDescription
subscribe?booleanWhether to subscribe to changes to the query results. Defaults to true.

Returns

Observable<ReturnType[]>

An observable for the query results.