aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/devices.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/store/devices.js')
-rw-r--r--modern/src/store/devices.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/modern/src/store/devices.js b/modern/src/store/devices.js
deleted file mode 100644
index f2f6263b..00000000
--- a/modern/src/store/devices.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import { createSlice } from '@reduxjs/toolkit';
-
-const { reducer, actions } = createSlice({
- name: 'devices',
- initialState: {
- items: {},
- selectedId: null,
- selectedIds: [],
- },
- reducers: {
- refresh(state, action) {
- state.items = {};
- action.payload.forEach((item) => state.items[item.id] = item);
- },
- update(state, action) {
- action.payload.forEach((item) => state.items[item.id] = item);
- },
- select(state, action) {
- state.selectedId = action.payload;
- },
- selectId(state, action) {
- state.selectedId = action.payload;
- state.selectedIds = state.selectedId ? [state.selectedId] : [];
- },
- selectIds(state, action) {
- state.selectedIds = action.payload;
- [state.selectedId] = state.selectedIds;
- },
- remove(state, action) {
- delete state.items[action.payload];
- },
- },
-});
-
-export { actions as devicesActions };
-export { reducer as devicesReducer };