refactor(extruder2): Consolidate state and event handling
This patch refactors the state management for the Extruder v2 on both the frontend and backend to use a more centralized and robust model. - **Backend (Rust):** - Replaced numerous individual events with two primary events: `StateEvent` for configuration and less frequent state, and `LiveValuesEvent` for high-frequency telemetry. - State-mutating API calls now emit the entire updated `StateEvent`. - **Frontend (TypeScript):** - Replaced multiple specialized hooks (`useInverter`, `useMode`, `useMotor`, etc.) with a single, comprehensive `useExtruder2` hook. - Centralized all client-side state, including optimistic updates, into the new `useExtruder2` hook. - UI components are updated to consume all data and actions from the single hook, simplifying data flow. - Renamed action functions to a consistent verb-first convention (e.g., `extruderSetMode` -> `setExtruderMode`).
This commit is contained in:
1 parent
d27eecd54c
commit
36089c3e75
8 files changed
+890
-1398