Cleaning up action names and compose drawer
This commit is contained in:
parent
92afd29650
commit
72591cc6d5
29 changed files with 468 additions and 151 deletions
17
app/assets/javascripts/components/reducers/timelines.jsx
Normal file
17
app/assets/javascripts/components/reducers/timelines.jsx
Normal file
|
@ -0,0 +1,17 @@
|
|||
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue