feat: add periodic interval using useEffect hook
This commit is contained in:
parent
16a94e936d
commit
3f5a901560
|
@ -1,7 +1,16 @@
|
|||
import React from 'react';
|
||||
import React, {useEffect} from 'react';
|
||||
|
||||
import Map from '../components/map/map';
|
||||
export default function MapPage() {
|
||||
useEffect(()=>{
|
||||
const intervalCall=setInterval(()=>{
|
||||
console.log('get data');
|
||||
}, 30000);
|
||||
return ()=>{
|
||||
/*clean up*/
|
||||
clearInterval(intervalCall);
|
||||
};
|
||||
},[]);
|
||||
return (
|
||||
<>
|
||||
{/*TODO remove debugging*/}
|
||||
|
|
Loading…
Reference in New Issue