docs-devsite/firestore_.loadbundletask.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
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><!-- -->.
<b>Signature:</b>
export declare class LoadBundleTask implements PromiseLike<LoadBundleTaskProgress>
<b>Implements:</b> PromiseLike<LoadBundleTaskProgress<!-- -->>
| Method | Modifiers | Description |
|---|---|---|
| catch(onRejected) | Implements the <code>Promise<LoadBundleTaskProgress>.catch</code> interface. | |
| onProgress(next, error, complete) | Registers functions to listen to bundle loading progress events. | |
| then(onFulfilled, onRejected) | Implements the <code>Promise<LoadBundleTaskProgress>.then</code> interface. |
Implements the Promise<LoadBundleTaskProgress>.catch interface.
<b>Signature:</b>
catch<R>(onRejected: (a: Error) => R | PromiseLike<R>): Promise<R | LoadBundleTaskProgress>;
| Parameter | Type | Description |
|---|---|---|
| onRejected | (a: Error) => R | PromiseLike<R> | Called when an error occurs during bundle loading. |
<b>Returns:</b>
Promise<R | LoadBundleTaskProgress<!-- -->>
Registers functions to listen to bundle loading progress events.
<b>Signature:</b>
onProgress(next?: (progress: LoadBundleTaskProgress) => unknown, error?: (err: Error) => unknown, complete?: () => void): void;
| Parameter | Type | Description |
|---|---|---|
| next | (progress: LoadBundleTaskProgress<!-- -->) => unknown | Called when there is a progress update from bundle loading. Typically <code>next</code> calls occur each time a Firestore document is loaded from the bundle. |
| error | (err: Error) => unknown | Called when an error occurs during bundle loading. The task aborts after reporting the error, and there should be no more updates after this. |
| complete | () => void | Called when the loading task is complete. |
<b>Returns:</b>
void
Implements the Promise<LoadBundleTaskProgress>.then interface.
<b>Signature:</b>
then<T, R>(onFulfilled?: (a: LoadBundleTaskProgress) => T | PromiseLike<T>, onRejected?: (a: Error) => R | PromiseLike<R>): Promise<T | R>;
| Parameter | Type | Description |
|---|---|---|
| onFulfilled | (a: LoadBundleTaskProgress<!-- -->) => T | PromiseLike<T> | Called on the completion of the loading task with a final <code>LoadBundleTaskProgress</code> update. The update will always have its <code>taskState</code> set to <code>"Success"</code>. |
| onRejected | (a: Error) => R | PromiseLike<R> | Called when an error occurs during bundle loading. |
<b>Returns:</b>
Promise<T | R>