auto update

This commit is contained in:
Niklas 2021-05-18 19:43:12 +02:00
parent 8ecd016eda
commit 00f5c83112

View File

@ -5,12 +5,15 @@ import Channel from './Channel';
function App() {
let [status,setStatus] = useState([])
useEffect(()=>{
(async ()=>{
async function update() {
const res = await fetch("https://node.kapelle.org/pub/ts3");
const json = await res.json();
setStatus(json);
})();
}
useEffect(()=>{
setInterval(update,30000)
update()
},[]);
return (