2017-11-18 12:11:18 +09:00
|
|
|
import { STATUS_CARD_FETCH_SUCCESS } from 'themes/glitch/actions/cards';
|
2017-01-20 09:00:14 +09:00
|
|
|
|
2017-07-11 08:00:14 +09:00
|
|
|
import { Map as ImmutableMap, fromJS } from 'immutable';
|
2017-01-20 09:00:14 +09:00
|
|
|
|
2017-07-11 08:00:14 +09:00
|
|
|
const initialState = ImmutableMap();
|
2017-01-20 09:00:14 +09:00
|
|
|
|
|
|
|
export default function cards(state = initialState, action) {
|
|
|
|
switch(action.type) {
|
|
|
|
case STATUS_CARD_FETCH_SUCCESS:
|
2017-07-11 08:00:14 +09:00
|
|
|
return state.set(action.id, fromJS(action.card));
|
2017-01-20 09:00:14 +09:00
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|