diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-04-20 12:15:13 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-04-20 12:15:13 +0530 |
commit | 2d5ec8721c2d9ae3d519dd5ff267a05b5f1ab96b (patch) | |
tree | 3e352b219ccfa178ca7f678d6a434a104bfdd987 /modern/src/store/notifications.js | |
parent | 047bf86480e2b3e215c13df2af0da456a664b507 (diff) | |
download | trackermap-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.js | 16 |
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 }; |