Created
October 19, 2018 21:53
-
-
Save edoantonioco/e8359a520e34eebb5507a13aa3cbdca0 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
import { Provider } from 'react-redux' | |
import Rutas from './src/Rutas'; | |
import store from './src/store3/index' | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<Provider store={store}> | |
<View style={styles.container}> | |
<StatusBar | |
backgroundColor="#1c313a" | |
barStyle="light-content" | |
/> | |
<Rutas /> | |
</View> | |
</Provider> | |
); | |
} | |
} |
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
//store/index.js | |
import { createStore} from 'redux' | |
import reducers from './reducers' | |
const store = createStore(reducers) | |
export default store |
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
//store/reducers/index.js | |
import { combineReducers} from 'redux' | |
import login from './login_reducer' | |
export default combineReducers({ | |
login | |
}) |
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
//store/reducers/login_reducers.js | |
export default reducer = (state = [], action) => { | |
if (action.type === 'LOGIN_RESULT') { | |
return action | |
} | |
return state | |
} | |
const action = { | |
type: "LOGIN_RESULT", | |
sessionID: action.sessionID, | |
mensajeError: action.mensajeError | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment