1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00
Files
Boostnote/browser/main/HomeContainer/reducer.js
2015-10-09 20:12:01 +09:00

20 lines
456 B
JavaScript

import { combineReducers } from 'redux'
import { USER_UPDATE } from './actions'
const initialCurrentUser = JSON.parse(localStorage.getItem('currentUser'))
function currentUser (state, action) {
switch (action.type) {
case USER_UPDATE:
let user = action.data
localStorage.setItem('currentUser', JSON.stringify(user))
return user
default:
return initialCurrentUser
}
}
export default combineReducers({
currentUser
})