Added code comments

This commit is contained in:
Keannu Bernasol 2023-07-25 14:17:28 +08:00
parent 40c52f1419
commit 473291646c

View file

@ -37,6 +37,8 @@ export default function Home() {
} }
} }
} }
// Refresh every 10 seconds
useEffect(() => { useEffect(() => {
const interval = setInterval(() => { const interval = setInterval(() => {
requestLocation(); requestLocation();
@ -44,6 +46,8 @@ export default function Home() {
return () => clearInterval(interval); return () => clearInterval(interval);
}); });
// Run when screen loads
useEffect(() => { useEffect(() => {
requestLocation(); requestLocation();
}, []); }, []);