Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default (initialState = { firebase: {} }) => {
// initialize firebase
const firebase = RNFirebase.initializeApp(reactNativeFirebaseConfig)
const store = createStore(
makeRootReducer(),
initialState, // initial state
compose(
reactReduxFirebase(firebase, reduxFirebaseConfig) // pass initialized react-native-firebase app instance
)
)
return store
}
export function initFirebase() {
let FirebaseServer = require('firebase-server');
new FirebaseServer(5000, 'localhost', {});
firebase.initializeApp(firebaseConfigForTesting);
}
return new Promise(function(resolve, reject) {
if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}
const serverTime = firebase.database().getServerTime();
console.log(serverTime, 'ServerTime');
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
user = user.toJSON();
getUser(user.email)
.then(user => resolve(user))
.catch(error => reject());
} else {
reject();
}
});
});
}
import React from 'react'
import { Core } from 'react-chunky'
import { AppRegistry, AsyncStorage, Text } from 'react-native'
import RNFirebase from 'react-native-firebase'
import * as Styles from './src/styles'
import * as Errors from './src/errors'
import * as Utils from './src/utils'
import * as Components from './src/components'
import Screen from './src/core/Screen'
import ListScreen from './src/core/ListScreen'
import App from './src/core/App'
global.storage = AsyncStorage
global.firebase = RNFirebase.initializeApp({
debug: true
})
export function renderApp(props) {
const main = () => (
)
AppRegistry.registerComponent(props.id, () => main)
}
export { Styles, Errors, Screen, ListScreen, App, Components, Utils }