docs
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<!-- /docs/redux/slices/database/locationDevicesSlice.md -->
|
||||
|
||||
# 🧩 locationDevicesSlice.js
|
||||
|
||||
Redux-Slice zur Verwaltung von Standortgeräten (Devices) aus der Tabelle `location_device`.
|
||||
|
||||
---
|
||||
|
||||
## Zustand
|
||||
|
||||
```js
|
||||
{
|
||||
data: [],
|
||||
status: "idle" | "loading" | "succeeded" | "failed",
|
||||
error: string | null
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Thunks
|
||||
|
||||
- `fetchLocationDevicesThunk`: Lädt Geräte aus der API
|
||||
|
||||
---
|
||||
|
||||
## Aktionen
|
||||
|
||||
- `clearLocationDevices()`: Löscht Geräte-Array und setzt Status zurück
|
||||
|
||||
---
|
||||
|
||||
## Selektoren
|
||||
|
||||
```js
|
||||
selectLocationDevices = (state) => state.locationDevices.data;
|
||||
selectLocationDeviceStatus = (state) => state.locationDevices.status;
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Besonderheiten
|
||||
|
||||
- Zustand wird bei `pending`, `fulfilled` und `rejected` aktualisiert
|
||||
- Fehlernachricht wird in `error` gespeichert
|
||||
Reference in New Issue
Block a user