aboutsummaryrefslogtreecommitdiff
path: root/src/store/groups.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/groups.js')
-rw-r--r--src/store/groups.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/store/groups.js b/src/store/groups.js
new file mode 100644
index 00000000..607b8609
--- /dev/null
+++ b/src/store/groups.js
@@ -0,0 +1,17 @@
+import { createSlice } from '@reduxjs/toolkit';
+
+const { reducer, actions } = createSlice({
+ name: 'groups',
+ initialState: {
+ items: {},
+ },
+ reducers: {
+ refresh(state, action) {
+ state.items = {};
+ action.payload.forEach((item) => state.items[item.id] = item);
+ },
+ },
+});
+
+export { actions as groupsActions };
+export { reducer as groupsReducer };