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.

18 lines
539 B

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