about summary refs log tree commit diff
path: root/app/assets/javascripts/components/reducers/cards.jsx
blob: 3c9395011e807a7df262e98ca7ee7384fb22a6f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { STATUS_CARD_FETCH_SUCCESS } from '../actions/cards';

import Immutable from 'immutable';

const initialState = Immutable.Map();

export default function cards(state = initialState, action) {
  switch(action.type) {
  case STATUS_CARD_FETCH_SUCCESS:
    return state.set(action.id, Immutable.fromJS(action.card));
  default:
    return state;
  }
};