Skip to content

Commit

Permalink
[ENH] Better fetching data from controller
Browse files Browse the repository at this point in the history
  • Loading branch information
dragarthPl committed Apr 10, 2024
1 parent 750a6ca commit df130fb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<React.StrictMode>
<Provider store={store}>
Expand Down

0 comments on commit df130fb

Please sign in to comment.