MDK Logo
UI Kitui-coreStores

devicesStore

Module-level singleton tracking selected devices, containers, sockets, and the device-tag map across the UI. Drives bulk-action toolbars, filtering, and the …

Module-level singleton tracking selected devices, containers, sockets, and the device-tag map across the UI. Drives bulk-action toolbars, filtering, and the device explorer.

import { createDevicesStore } from "@tetherto/mdk-ui-core";

State

NameSignature
filterTagsstring[]
selectedContainersRecord<string, DevicePayload>
selectedDevicesDevicePayload[]
selectedDevicesTagsRecord<string, Record<string, DeviceTag>>
selectedLvCabinetsRecord<string, DevicePayload>
selectedSocketsRecord<string, { sockets: SocketData[] }>

Actions

NameSignature
removeDeviceTag(payload: DeviceTagPayload) => void
removeFilterTag(tag: string) => void
removeMultipleContainers(devices: DevicePayload[]) => void
removeMultipleSelectedDevices(deviceIds: string[]) => void
removeMultipleSelectedSockets(sockets: SocketData[]) => void
removeSelectedContainer(device: DevicePayload) => void
removeSelectedDevice(deviceId: string) => void
removeSelectedLVCabinet(device: DevicePayload) => void
removeSelectedSocket(payload: RemoveSocketPayload) => void
resetSelectedDevicesTags() => void
selectContainer(device: DevicePayload) => void
selectDeviceTag(payload: DeviceTagPayload) => void
selectLVCabinet(device: DevicePayload) => void
selectMultipleContainers(devices: DevicePayload[]) => void
setFilterTags(tags: string[]) => void
setMultipleSelectedDevices(devices: DevicePayload[]) => void
setMultipleSelectedSockets(sockets: SocketData[]) => void
setResetSelections() => void
setSelectDevice(device: DevicePayload) => void
setSelectedDevices(devices: DevicePayload[]) => void
setSelectedLvCabinets(devices: Record<string, DevicePayload>) => void
setSelectedSockets(sockets: Record<string, { sockets: SocketData[] }>) => void
setSelectSocket(socket: SocketData) => void