catstodon/app/javascript/themes/glitch/reducers/cards.js

15 lines
380 B
JavaScript
Raw Normal View History

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