10 lines
260 B
JavaScript
10 lines
260 B
JavaScript
|
import * as actions from '../actions';
|
||
|
import { Map } from 'immutable';
|
||
|
|
||
|
export default function user(state = Map(), action) {
|
||
|
if (action.type === actions.LOGIN.SUCCESS) {
|
||
|
return Map(action.payload).set('token', action.meta.token);
|
||
|
}
|
||
|
return state;
|
||
|
}
|