about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers/cards.js
blob: 92ecfd0863903c217fc5b62cd41e91edb981ef9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { STATUS_CARD_FETCH_SUCCESS } from 'flavours/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;
  }
};