Skip to content

Instantly share code, notes, and snippets.

@edoantonioco
Created October 19, 2018 21:49
Show Gist options
  • Save edoantonioco/4bef750268a6bb19dbb52e48b4ea84f9 to your computer and use it in GitHub Desktop.
Save edoantonioco/4bef750268a6bb19dbb52e48b4ea84f9 to your computer and use it in GitHub Desktop.
//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