2016-10-30 10:06:43 -04:00
|
|
|
import { ACCESS_TOKEN_SET } from '../actions/meta';
|
|
|
|
import { ACCOUNT_SET_SELF } from '../actions/accounts';
|
|
|
|
import Immutable from 'immutable';
|
2016-08-26 13:12:19 -04:00
|
|
|
|
|
|
|
const initialState = Immutable.Map();
|
|
|
|
|
|
|
|
export default function meta(state = initialState, action) {
|
|
|
|
switch(action.type) {
|
2016-08-31 10:15:12 -04:00
|
|
|
case ACCESS_TOKEN_SET:
|
2016-08-26 13:12:19 -04:00
|
|
|
return state.set('access_token', action.token);
|
2016-10-30 10:06:43 -04:00
|
|
|
case ACCOUNT_SET_SELF:
|
|
|
|
return state.set('me', action.account.id);
|
2016-08-26 13:12:19 -04:00
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
2016-09-12 13:20:55 -04:00
|
|
|
};
|