aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/notifications.js
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-04-20 12:15:13 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-04-20 12:15:13 +0530
commit2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b (patch)
tree3e352b219ccfa178ca7f678d6a434a104bfdd987 /modern/src/store/notifications.js
parent047bf86480e2b3e215c13df2af0da456a664b507 (diff)
downloadtrackermap-web-2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b.tar.gz
trackermap-web-2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b.tar.bz2
trackermap-web-2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b.zip
Created mostly used stores
Diffstat (limited to 'modern/src/store/notifications.js')
-rw-r--r--modern/src/store/notifications.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/modern/src/store/notifications.js b/modern/src/store/notifications.js
new file mode 100644
index 00000000..be8a9890
--- /dev/null
+++ b/modern/src/store/notifications.js
@@ -0,0 +1,16 @@
+import { createSlice } from '@reduxjs/toolkit';
+
+const { reducer, actions } = createSlice({
+ name: 'notifications',
+ initialState: {
+ items: {},
+ },
+ reducers: {
+ update(state, action) {
+ action.payload.forEach(item => state.items[item['id']] = item);
+ },
+ }
+});
+
+export { actions as notificationsActions };
+export { reducer as notificationsReducer };