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