Skip to content

Instantly share code, notes, and snippets.

@johnnydecimal
Last active November 5, 2018 09:16
Show Gist options
  • Save johnnydecimal/ca096a5f5e259a53134f339d00466082 to your computer and use it in GitHub Desktop.
Save johnnydecimal/ca096a5f5e259a53134f339d00466082 to your computer and use it in GitHub Desktop.
// I'll explain what Rebase is for later
import Rebase from 're-base';
// Note we import from 'firebase/app' not just 'firebase'. This avoids a nagging console
// warning ("It looks like you're using the development build of the Firebase JS SDK.")
import firebase from 'firebase/app';
// Similarly, on line 15 we need the database module, so that's exactly what we specify here.
require('firebase/database');
const firebaseApp = firebase.initializeApp({
apiKey: 'your-api-key-here',
authDomain: 'your-domain.firebaseapp.com',
databaseURL: 'https://your-domain.firebaseio.com',
});
const base = Rebase.createClass(firebaseApp.database());
export { firebaseApp };
export default base;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment