aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/groups.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-04-26 22:56:40 -0700
committerGitHub <noreply@github.com>2021-04-26 22:56:40 -0700
commit17e1f8c7b67a36c4e9384b7c7b930b68c8bfd6f4 (patch)
treecc596678a30c0c50d1a99831e30839cd964ed501 /modern/src/store/groups.js
parent047bf86480e2b3e215c13df2af0da456a664b507 (diff)
parent127a2628b61b0a151eb5225af7ecaf483f907665 (diff)
downloadtrackermap-web-17e1f8c7b67a36c4e9384b7c7b930b68c8bfd6f4.tar.gz
trackermap-web-17e1f8c7b67a36c4e9384b7c7b930b68c8bfd6f4.tar.bz2
trackermap-web-17e1f8c7b67a36c4e9384b7c7b930b68c8bfd6f4.zip
Merge pull request #844 from mail2bishnoi/stores
Created mostly used stores
Diffstat (limited to 'modern/src/store/groups.js')
-rw-r--r--modern/src/store/groups.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/modern/src/store/groups.js b/modern/src/store/groups.js
new file mode 100644
index 00000000..483323f3
--- /dev/null
+++ b/modern/src/store/groups.js
@@ -0,0 +1,16 @@
+import { createSlice } from '@reduxjs/toolkit';
+
+const { reducer, actions } = createSlice({
+ name: 'groups',
+ initialState: {
+ items: {},
+ },
+ reducers: {
+ update(state, action) {
+ action.payload.forEach(item => state.items[item['id']] = item);
+ },
+ }
+});
+
+export { actions as groupsActions };
+export { reducer as groupsReducer };