JSON Dateien in einem Ordner verschoben
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
// redux/store/variablesSlice.ts
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { DataTDR } from "../types/chartDataTypesTDR";
|
||||
|
||||
// Typ für den State
|
||||
export interface VariablesState {
|
||||
selectedChartData: DataTDR[] | null;
|
||||
//------------
|
||||
kueBezeichnungen: string[];
|
||||
isolationsgrenzwerte: number[];
|
||||
@@ -63,6 +65,7 @@ export interface VariablesState {
|
||||
// Initialer Zustand
|
||||
const initialState: VariablesState = {
|
||||
//------------
|
||||
selectedChartData: null,
|
||||
kueBezeichnungen: [],
|
||||
isolationsgrenzwerte: [],
|
||||
verzoegerung: [],
|
||||
@@ -141,8 +144,12 @@ const variablesSlice = createSlice({
|
||||
] as VariablesState[keyof VariablesState]) = value!;
|
||||
});
|
||||
},
|
||||
setSelectedChartData(state, action: PayloadAction<DataTDR[] | null>) {
|
||||
state.selectedChartData = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setVariable, setVariables } = variablesSlice.actions;
|
||||
export const { setVariable, setVariables, setSelectedChartData } =
|
||||
variablesSlice.actions;
|
||||
export default variablesSlice.reducer;
|
||||
|
||||
5
redux/types/chartDataTypesTDR.ts
Normal file
5
redux/types/chartDataTypesTDR.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
// redux/types/chartDataTypesTDR.ts
|
||||
export interface DataTDR {
|
||||
t: number; // Zeitstempel oder Index
|
||||
m: number; // Pegelwert
|
||||
}
|
||||
Reference in New Issue
Block a user