// _app.js import { useEffect } from "react"; import { loadWindowVariables } from "../utils/loadWindowVariables"; import Header from "../components/Header"; import Navigation from "../components/Navigation"; import Footer from "../components/Footer"; import "../styles/globals.css"; import { Provider } from "react-redux"; import { setVariables } from "../store/variablesSlice"; import store from "../store/store"; function MyApp({ Component, pageProps }) { useEffect(() => { const loadAndStoreVariables = async () => { const variables = await loadWindowVariables(); store.dispatch(setVariables(variables)); }; if (typeof window !== "undefined") { loadAndStoreVariables(); // Initial load // Interval for updating the Redux store every 10 seconds const intervalId = setInterval(loadAndStoreVariables, 10000); // Cleanup interval when component unmounts return () => clearInterval(intervalId); } }, []); return (
); } export default MyApp;