about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/cards.js
blob: 4d86b0d7e7a0821ee336ee2405d44717c167440d (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 { 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;
  }
};