bigbuffet-rw/app/gabsocial/reducers/me.js
2020-04-14 15:45:38 -05:00

20 lines
495 B
JavaScript

import { ME_FETCH_SUCCESS, ME_FETCH_FAIL, ME_FETCH_SKIP } from '../actions/me';
import { AUTH_LOGGED_OUT } from '../actions/auth';
import { fromJS } from 'immutable';
const initialState = null;
export default function me(state = initialState, action) {
switch(action.type) {
case ME_FETCH_SUCCESS:
return fromJS(action.me.id);
case ME_FETCH_FAIL:
return false;
case ME_FETCH_SKIP:
return false;
case AUTH_LOGGED_OUT:
return false;
default:
return state;
}
};