Refactor: Reorganize state management into atoms and selectors directories

Moved all Recoil atoms to a new 'atoms' directory and selectors to a 'selectors' directory to clarify the project structure and improve maintainability. This change separates concerns by clearly distinguishing between simple state (atoms) and derived state (selectors), facilitating better understanding and scalability of the application's state management.
This commit is contained in:
ISA
2024-05-03 10:18:42 +02:00
parent 9b8361dba7
commit 39e5e1cb5a
12 changed files with 132 additions and 36 deletions

View File

@@ -0,0 +1,7 @@
// Pfad: store/atoms/gisStationState.js
import { atom } from "recoil";
export const gisStationsStaticDistrictState = atom({
key: "gisStationsStaticDistrict", // Eindeutiger Schlüssel (innerhalb des Projekts)
default: [], // Standardwert (Anfangszustand)
});

View File

@@ -0,0 +1,7 @@
// Pfad: store/atoms/gisStationState.js
import { atom } from "recoil";
export const gisSystemStaticState = atom({
key: "gisSystemStatic", // Eindeutiger Schlüssel (innerhalb des Projekts)
default: [], // Standardwert (Anfangszustand)
});

View File

@@ -0,0 +1,24 @@
// store/mapLayersState.js
import { atom } from "recoil";
export const mapLayersState = atom({
key: "mapLayersState", // Eindeutiger Schlüssel für das Atom
default: {
// Standardwerte für jeden Layer
TALAS: true,
ECI: true,
ULAF: true,
GSMModem: true,
CiscoRouter: true,
WAGO: true,
Siemens: true,
OTDR: true,
WDM: true,
GMA: true,
Messstellen: true,
TALASICL: true,
DAUZ: true,
"SMS-Funkmodem": true,
Sonstige: true,
},
});

View File

@@ -0,0 +1,7 @@
// store/poiTypState.js
import { atom } from "recoil";
export const poiTypState = atom({
key: "poiTypState", // eindeutiger Schlüssel
default: [], // Initialer Standardwert, leeres Array
});

View File

@@ -0,0 +1,7 @@
// In deinem Recoil store
import { atom } from "recoil";
export const selectedAreaState = atom({
key: "selectedAreaState", // unique ID (with respect to other atoms/selectors)
default: null, // default value (aka initial value)
});

View File

@@ -0,0 +1,7 @@
// store/zoomTriggerState.js
import { atom } from "recoil";
export const zoomTriggerState = atom({
key: "zoomTriggerState",
default: 0, // Dies kann eine einfache Zählvariable sein, die inkrementiert wird.
});