blob: fb934489b69d20a5cf076b3528e8e3162aa8ce30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
import makeList from "./utils/list"
export const UPDATE_FLOWS = "UPDATE_FLOWS"
const {
reduceList,
updateList,
fetchList,
} = makeList(UPDATE_FLOWS, "/flows")
const defaultState = {
all: reduceList(),
}
export default function reducer(state = defaultState, action) {
switch (action.type) {
case UPDATE_FLOWS:
let all = reduceList(state.all, action)
return {
...state,
all,
}
default:
return state
}
}
export {updateList as updateFlows, fetchList as fetchFlows}
|