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
atom-sync |
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
constructor() { | |
super(); | |
this.ref = firebase.firestore().collection('posts'); | |
this.unsubscribe = null; | |
this.state = { | |
posts: [], | |
loading: true, | |
}; | |
} |
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
addRandomPost = () => { | |
this.ref.add({ | |
title: 'Added post by random button', | |
likes: Math.floor((Math.random() * 10) + 1), | |
uri: `https://picsum.photos/200/300?image=${Math.floor((Math.random() * 100) + 1)}`, | |
}); | |
} |
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
constructor() { | |
super(); | |
this.ref = firebase.firestore().collection('posts'); | |
this.firestoreUnsubscriber = null; | |
this.authUnsubscriber = null; | |
this.state = { | |
posts: [], | |
loading: true, | |
loggingIn: false, | |
user: null, |
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
onLogin = async () => { | |
try { | |
const response = await firebase.auth().signInWithEmailAndPassword(this.state.emailValue, this.state.passwordValue); | |
console.log(response); | |
this.setState({ | |
loggingIn: false, | |
emailValue: '', | |
passwordValue: '', | |
hasError: false, | |
error: '', |
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
import { createStore, applyMiddleware } from 'redux'; | |
import { persistStore, persistReducer } from 'redux-persist'; | |
import storage from 'redux-persist/lib/storage'; | |
import ReduxThunk from 'redux-thunk'; | |
import logger from 'redux-logger'; | |
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'; | |
import rootReducer from '../reducers'; | |
const middlewares = [ReduxThunk]; |
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
import React from 'react'; | |
import { AppRegistry, Text } from 'react-native'; | |
import { Provider } from 'react-redux'; | |
import { PersistGate } from 'redux-persist/lib/integration/react'; | |
import configureStore from './src/config/store'; | |
import App from './App'; | |
const { store, persistor } = configureStore(); |
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
import types from '../actions/types'; | |
const initialState = { | |
loggedIn: false, | |
isFetching: false, | |
hasError: false, | |
errorMessage: '', | |
user: null | |
}; |
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
import React, { Component } from 'react'; | |
import { | |
Text, | |
View, | |
ActivityIndicator, | |
FlatList, | |
Button, | |
TouchableOpacity, | |
} from 'react-native'; | |
import firebase from 'react-native-firebase'; |
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
### Keybase proof | |
I hereby claim: | |
* I am dlevai94 on github. | |
* I am davidlevai (https://keybase.io/davidlevai) on keybase. | |
* I have a public key ASAOdV3xUbOJPm2SsdSixNjloFsfFPQMbATUD0orpJh-Fgo | |
To claim this, I am signing this object: |
OlderNewer