JSFiddle - React, Tailwind, and code Playground

by Ulrich Bangert

JavaScript

apiCall = async () => {   
  let res = await fetch('https://blockchain.info/q/getdifficulty');
  let data = await res.json();
 
  console.log('apicall(): ' + data);
};
apiCall2 = async () => {   
  let res = await fetch('https://blockchain.info/q/getdifficulty');
  let data = await res.json();
 
  console.log('apicall2: ' + data);
};

setInterval(apiCall(), 2000);
setInterval(apiCall2, 2000);