♻️ Refactor: cleanupMarkers util eingeführt für alle Marker-Typen + ✨ Feature: Heap-Memory-Monitoring über Redux-Slice mit Auto-Reload bei >8GB
This commit is contained in:
22
redux/slices/heapMonitorSlice.js
Normal file
22
redux/slices/heapMonitorSlice.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = {
|
||||
heapBytes: 0,
|
||||
heapMB: 0,
|
||||
lastUpdated: null,
|
||||
};
|
||||
|
||||
export const heapMonitorSlice = createSlice({
|
||||
name: "heapMonitor",
|
||||
initialState,
|
||||
reducers: {
|
||||
updateHeap(state, action) {
|
||||
state.heapBytes = action.payload;
|
||||
state.heapMB = +(action.payload / 1024 / 1024).toFixed(2);
|
||||
state.lastUpdated = new Date().toISOString();
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { updateHeap } = heapMonitorSlice.actions;
|
||||
export default heapMonitorSlice.reducer;
|
||||
Reference in New Issue
Block a user