blob: d69d663285048fc2c71432e00cdee995379247d2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
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) {
list.unshift(Immutable.fromJS(action.status));
});
default:
return state;
}
}
|