replace redux with zustand
This commit is contained in:
29
src/App.tsx
29
src/App.tsx
@@ -1,25 +1,14 @@
|
||||
import "./App.css";
|
||||
import Timetable from "./components/Timetable/Timetable";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { fetchTimetable } from "./store/index";
|
||||
import { useEffect } from "react";
|
||||
import { type AppDispatch } from "./store/index";
|
||||
import Flatastic from "./components/Flatastic/Flatastic";
|
||||
import fetchFlatasticChores from "./store/thunks/fetchFlatasticChores";
|
||||
import "@/App.css";
|
||||
import Timetable from "@/components/Timetable/Timetable";
|
||||
import Flatastic from "@/components/Flatastic/Flatastic";
|
||||
|
||||
function App() {
|
||||
const dispatch = useDispatch<AppDispatch>();
|
||||
// Fetch the timetable data when the app loads
|
||||
useEffect(() => {
|
||||
dispatch(fetchTimetable());
|
||||
dispatch(fetchFlatasticChores());
|
||||
}, [dispatch]);
|
||||
return (
|
||||
<>
|
||||
<Timetable />
|
||||
<Flatastic />
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<Timetable />
|
||||
<Flatastic />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
Reference in New Issue
Block a user