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