about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers/cards.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/flavours/glitch/reducers/cards.js')
-rw-r--r--app/javascript/flavours/glitch/reducers/cards.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/reducers/cards.js b/app/javascript/flavours/glitch/reducers/cards.js
new file mode 100644
index 000000000..92ecfd086
--- /dev/null
+++ b/app/javascript/flavours/glitch/reducers/cards.js
@@ -0,0 +1,14 @@
+import { STATUS_CARD_FETCH_SUCCESS } from 'flavours/glitch/actions/cards';
+
+import { Map as ImmutableMap, fromJS } from 'immutable';
+
+const initialState = ImmutableMap();
+
+export default function cards(state = initialState, action) {
+  switch(action.type) {
+  case STATUS_CARD_FETCH_SUCCESS:
+    return state.set(action.id, fromJS(action.card));
+  default:
+    return state;
+  }
+};