aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks/flows.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/ducks/flows.js')
-rw-r--r--web/src/js/ducks/flows.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/web/src/js/ducks/flows.js b/web/src/js/ducks/flows.js
new file mode 100644
index 00000000..fb934489
--- /dev/null
+++ b/web/src/js/ducks/flows.js
@@ -0,0 +1,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} \ No newline at end of file