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>.

Index

Methods

catch

  • catch < R > ( onRejected ( a Error ) => R | PromiseLike < R > ) : Promise < R | LoadBundleTaskProgress >
  • Implements the Promise<LoadBundleTaskProgress>.catch interface.

    Type parameters

    • R

    Parameters

    • onRejected: (a: Error) => R | PromiseLike<R>

      Called when an error occurs during bundle loading.

        • (a: Error): R | PromiseLike<R>
        • Parameters

          Returns R | PromiseLike<R>

    Returns Promise<R | LoadBundleTaskProgress>

onProgress

  • onProgress ( next ? :  ( progress LoadBundleTaskProgress ) => any ,  error ? :  ( error Error ) => any ,  complete ? :  ( ) => void ) : void
  • Registers functions to listen to bundle loading progress events.

    Parameters

    • Optional next: (progress: LoadBundleTaskProgress) => any

      Called when there is a progress update from bundle loading. Typically next calls occur each time a Firestore document is loaded from the bundle.

    • Optional error: (error: Error) => any

      Called when an error occurs during bundle loading. The task aborts after reporting the error, and there should be no more updates after this.

        • Parameters

          Returns any

    • Optional complete: () => void

      Called when the loading task is complete.

        • (): void
        • Returns void

    Returns void

then

  • then < T ,  R > ( onFulfilled ? :  ( a LoadBundleTaskProgress ) => T | PromiseLike < T > ,  onRejected ? :  ( a Error ) => R | PromiseLike < R > ) : Promise < T | R >
  • Implements the Promise<LoadBundleTaskProgress>.then interface.

    Type parameters

    • T

    • R

    Parameters

    • Optional onFulfilled: (a: LoadBundleTaskProgress) => T | PromiseLike<T>

      Called on the completion of the loading task with a final LoadBundleTaskProgress update. The update will always have its taskState set to "Success".

    • Optional onRejected: (a: Error) => R | PromiseLike<R>

      Called when an error occurs during bundle loading.

        • (a: Error): R | PromiseLike<R>
        • Parameters

          Returns R | PromiseLike<R>

    Returns Promise<T | R>