How to use the @firebase/app.app function in @firebase/app

To help you get started, we’ve selected a few @firebase/app examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ddmng / fontah / src / fx / firebase.js View on Github external
const syncData = (props, dispatch) =>
    firebase.app(props.database)
    .firestore()
    .collection(props.collection)
    .doc(props.key)
    .onSnapshot(doc => {
        console.log("Received update from firebase!", doc.data())

        props.actions.map(action =>
            dispatch(action, {
                document: doc.data()
            })
        )
    }, e => {
        console.error("Error querying resource", e)
        dispatch(props.error, {e});
    })
github angular / angularfire / src / core / firebase.app.module.ts View on Github external
export function _firebaseAppFactory(config: FirebaseAppConfig, appName?: string): FirebaseApp {
  try {
    if (appName) {
      return firebase.initializeApp(config, appName) as FirebaseApp;
    } else {
      return firebase.initializeApp(config) as FirebaseApp;
    }
  }
  catch (e) {
    if (e.code === "app/duplicate-app") {
      return firebase.app(e.name) as FirebaseApp;
    }

    return firebase.app(null!) as FirebaseApp;
  }
}
github angular / angularfire / src / core / firebase.app.module.ts View on Github external
export function _firebaseAppFactory(config: FirebaseAppConfig, appName?: string): FirebaseApp {
  try {
    if (appName) {
      return firebase.initializeApp(config, appName) as FirebaseApp;
    } else {
      return firebase.initializeApp(config) as FirebaseApp;
    }
  }
  catch (e) {
    if (e.code === "app/duplicate-app") {
      return firebase.app(e.name) as FirebaseApp;
    }

    return firebase.app(null!) as FirebaseApp;
  }
}