You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
556 B

import { TIMELINE_SET, TIMELINE_UPDATE } from '../actions/timelines';
import Immutable from 'immutable';
const initialState = Immutable.Map();
export default function timelines(state = initialState, action) {
switch(action.type) {
case TIMELINE_SET:
return state.set(action.timeline, Immutable.fromJS(action.statuses));
case TIMELINE_UPDATE:
return state.update(action.timeline, function (list) {
return list.unshift(Immutable.fromJS(action.status));
});
default:
return state;
}
}