Refactor 'me' reducer
This commit is contained in:
parent
5781d0de07
commit
c40fb925e9
1 changed files with 1 additions and 2 deletions
|
@ -1,13 +1,12 @@
|
||||||
import { ME_FETCH_SUCCESS, ME_FETCH_FAIL, ME_FETCH_SKIP } from '../actions/me';
|
import { ME_FETCH_SUCCESS, ME_FETCH_FAIL, ME_FETCH_SKIP } from '../actions/me';
|
||||||
import { AUTH_LOGGED_OUT } from '../actions/auth';
|
import { AUTH_LOGGED_OUT } from '../actions/auth';
|
||||||
import { fromJS } from 'immutable';
|
|
||||||
|
|
||||||
const initialState = null;
|
const initialState = null;
|
||||||
|
|
||||||
export default function me(state = initialState, action) {
|
export default function me(state = initialState, action) {
|
||||||
switch(action.type) {
|
switch(action.type) {
|
||||||
case ME_FETCH_SUCCESS:
|
case ME_FETCH_SUCCESS:
|
||||||
return fromJS(action.me.id);
|
return action.me.id;
|
||||||
case ME_FETCH_FAIL:
|
case ME_FETCH_FAIL:
|
||||||
return false;
|
return false;
|
||||||
case ME_FETCH_SKIP:
|
case ME_FETCH_SKIP:
|
||||||
|
|
Loading…
Reference in a new issue