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