Skip to content

Instantly share code, notes, and snippets.

@kcchien
Created September 25, 2018 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kcchien/1f2d5eaf6347a5df1567f7ba7f40765d to your computer and use it in GitHub Desktop.
Save kcchien/1f2d5eaf6347a5df1567f7ba7f40765d to your computer and use it in GitHub Desktop.
// Config file
import * as firebase from "firebase";
const config = {...};
export default !firebase.apps.length ? firebase.initializeApp(config) : firebase.app();
// Other file
import firebase from '../firebase';
...
console.log(firebase.name);
console.log(firebase.database());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment