Last active
August 16, 2018 18:05
-
-
Save adamkpurdy/e6726e6f00b60021e38fb669687be826 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <template> | |
| <div id="q-app"> | |
| <router-view /> | |
| </div> | |
| </template> | |
| <script> | |
| import firebase from 'firebase'; | |
| import 'firebase/firestore'; | |
| import firebaseApp from 'firebase/app'; | |
| import * as configs from './utils/firebase/config'; | |
| export default { | |
| name: 'App', | |
| preFetch({ store }) { | |
| // TODO: SET PRODUCTION CONFIG WHEN CI PUSHES TO PRODUCTION | |
| // const config = (process.env.DEV) ? configs.dev : configs.prod; | |
| firebaseApp.initializeApp(configs.dev); | |
| const $db = firebase.firestore(); | |
| // Firebase requirement | |
| $db.settings({ | |
| timestampsInSnapshots: true, | |
| }); | |
| // Put firebase functionality into | |
| // state for future access | |
| Object.assign(store.state, { | |
| $db: firebase.firestore(), | |
| $firebase: firebaseApp, | |
| }); | |
| }, | |
| }; | |
| </script> | |
| <style></style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment