aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/commands.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/store/commands.js')
-rw-r--r--modern/src/store/commands.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/modern/src/store/commands.js b/modern/src/store/commands.js
new file mode 100644
index 0000000..d18d609
--- /dev/null
+++ b/modern/src/store/commands.js
@@ -0,0 +1,16 @@
+import { createSlice } from '@reduxjs/toolkit';
+
+const { reducer, actions } = createSlice({
+ name: 'commands',
+ initialState: {
+ items: {},
+ },
+ reducers: {
+ update(state, action) {
+ action.payload.forEach(item => state.items[item['id']] = item);
+ },
+ }
+});
+
+export { actions as commandsActions };
+export { reducer as commandsReducer };