about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/flavours/glitch/reducers/rules.js')
-rw-r--r--app/javascript/flavours/glitch/reducers/rules.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/reducers/rules.js b/app/javascript/flavours/glitch/reducers/rules.js
new file mode 100644
index 000000000..6cc2230bc
--- /dev/null
+++ b/app/javascript/flavours/glitch/reducers/rules.js
@@ -0,0 +1,13 @@
+import { RULES_FETCH_SUCCESS } from 'flavours/glitch/actions/rules';
+import { List as ImmutableList, fromJS } from 'immutable';
+
+const initialState = ImmutableList();
+
+export default function rules(state = initialState, action) {
+  switch (action.type) {
+  case RULES_FETCH_SUCCESS:
+    return fromJS(action.rules);
+  default:
+    return state;
+  }
+}