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