LoadBundleTask
Represents the task of loading a Firestore bundle. It provides progress of bundle loading, as well as task completion and error events.
The API is compatible with Promise<LoadBundleTaskProgress>
.
class LoadBundleTask implements PromiseLike<LoadBundleTaskProgress> {}
onProgress(
next?: (progress: LoadBundleTaskProgress) => unknown,
error?: (err: Error) => unknown,
complete?: () => void,
): void;then<T, R>(onFulfilled?: (a: LoadBundleTaskProgress) => T | PromiseLike<T>, onRejected?: (a: Error) => R | PromiseLike<R>): Promise<T | R>;
§Implements
§
PromiseLike<LoadBundleTaskProgress>
[src]§Methods
§
Implements the Promise<LoadBundleTaskProgress>.catch
interface.
@param onRejected
- Called when an error occurs during bundle loading.
§
onProgress(next?: (progress: LoadBundleTaskProgress) => unknown, error?: (err: Error) => unknown, complete?: () => void): void
[src]Registers functions to listen to bundle loading progress events.
@param next
- Called when there is a progress update from bundle loading. Typically
next
calls occur each time a Firestore document is loaded from the bundle.
@param error
- Called when an error occurs during bundle loading. The task aborts after reporting the error, and there should be no more updates after this.
@param complete
- Called when the loading task is complete.
§
then<T, R>(onFulfilled?: (a: LoadBundleTaskProgress) => T | PromiseLike<T>, onRejected?: (a: Error) => R | PromiseLike<R>): Promise<T | R>
[src]Implements the Promise<LoadBundleTaskProgress>.then
interface.
@param onFulfilled
- Called on the completion of the loading task with a final
LoadBundleTaskProgress
update. The update will always have itstaskState
set to"Success"
.
@param onRejected
- Called when an error occurs during bundle loading.