This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-12-03 23:26:40 -08:00
|
|
|
import { STATUS_CARD_FETCH_SUCCESS } from 'flavours/glitch/actions/cards';
|
2017-01-19 16:00:14 -08:00
|
|
|
|
2017-07-10 16:00:14 -07:00
|
|
|
import { Map as ImmutableMap, fromJS } from 'immutable';
|
2017-01-19 16:00:14 -08:00
|
|
|
|
2017-07-10 16:00:14 -07:00
|
|
|
const initialState = ImmutableMap();
|
2017-01-19 16:00:14 -08:00
|
|
|
|
|
|
|
export default function cards(state = initialState, action) {
|
|
|
|
switch(action.type) {
|
|
|
|
case STATUS_CARD_FETCH_SUCCESS:
|
2017-07-10 16:00:14 -07:00
|
|
|
return state.set(action.id, fromJS(action.card));
|
2017-01-19 16:00:14 -08:00
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|