Skip to content

Instantly share code, notes, and snippets.

@edoantonioco
Created October 19, 2018 21:53
Show Gist options
  • Save edoantonioco/e8359a520e34eebb5507a13aa3cbdca0 to your computer and use it in GitHub Desktop.
Save edoantonioco/e8359a520e34eebb5507a13aa3cbdca0 to your computer and use it in GitHub Desktop.
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>
);
}
}
//store/index.js
import { createStore} from 'redux'
import reducers from './reducers'
const store = createStore(reducers)
export default store
//store/reducers/index.js
import { combineReducers} from 'redux'
import login from './login_reducer'
export default combineReducers({
login
})
//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