Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FirebaseUtils

A class that defines utility functions that help Wrap the Firebase JavaScript API.

Hierarchy

  • FirebaseUtils

Index

Methods

Static wrapFirebaseAsyncCall

  • wrapFirebaseAsyncCall(obj: any, fn: Function, args?: any[]): Promise<any[]>
  • Wraps the given Firebase call in a Promise. When the async call returns, the Promise resolves with the callback arguments in an array.

    Parameters

    • obj: any

      The object that the given function should be called on. This is typically your Firebase ref instance.

    • fn: Function

      The function that should be wrapped.

    • Default value args: any[] = []

      The Arguments that should be given to Firebase.

    Returns Promise<any[]>

Static wrapFirebaseEvent

  • wrapFirebaseEvent(firebase: Firebase, eventName: string): Observable<any[]>
  • Gets an observable that represents the given event name for the internal Firebase instance. Whenever the event is triggered by the internal Firebase instance, the Observable will resolve with the new data. This function is useful to map Firebase events to Observables. When the observable is disposed, the event listener is removed.

    Parameters

    • firebase: Firebase

      The Raw Firebase JavaScript API Object.

    • eventName: string

      The name of the event that should be listened to.

    Returns Observable<any[]>

Generated using TypeDoc