Last active
July 2, 2017 04:09
-
-
Save romanonthego/5b6fd14afe7c1ace671692d8b8472097 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require with Promise wrapper / dynamic import() | |
import importFirebase from 'firebaseImport' | |
export default function firebase() { | |
return importFirebase().then((firebase) => { | |
// do that ever you need here. | |
// something like: | |
const app = firebase.initializeApp({ | |
apiKey: '<your-api-key>', | |
authDomain: '<your-auth-domain>', | |
databaseURL: '<your-database-url>', | |
storageBucket: '<your-storage-bucket>', | |
messagingSenderId: '<your-sender-id>' | |
}) | |
// return actully usable objects: | |
return { | |
database: app.database() | |
auth: app.auth() | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment