From df130fb76a4d08247a1cd12c80f4ef1ecf0e59f6 Mon Sep 17 00:00:00 2001 From: Marcin Goncerzewicz Date: Thu, 11 Apr 2024 00:16:23 +0200 Subject: [PATCH] [ENH] Better fetching data from controller --- frontend/src/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/index.js b/frontend/src/index.js index 34b8ae8..09fb7d9 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -6,13 +6,15 @@ import reportWebVitals from './reportWebVitals'; import { store } from './store' import { Provider } from 'react-redux' import {fetchHeatingTemperature, fetchMixerTemperature, fetchWaterHeaterTemperature} from "./features/temperature/temepratureSlice"; +import {fetchStoveState} from "./features/stoveState/stoveStateSlice"; const root = ReactDOM.createRoot(document.getElementById('root')); -store.dispatch(fetchHeatingTemperature()).then(() => { - store.dispatch(fetchMixerTemperature()).then(() => { - store.dispatch(fetchWaterHeaterTemperature()); - }); -}); + +store.dispatch(fetchHeatingTemperature()); +store.dispatch(fetchMixerTemperature()); +store.dispatch(fetchWaterHeaterTemperature()); +store.dispatch(fetchStoveState()); + root.render(