diff options
Diffstat (limited to 'modern/src/store/groups.js')
-rw-r--r-- | modern/src/store/groups.js | 16 |
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 }; |