This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
useCallback, | |
useRef | |
} from "https://cdn.skypack.dev/react@17.0.1"; | |
import { render } from "https://cdn.skypack.dev/react-dom@17.0.1"; | |
let apiFetching = false; | |
let apiLastRun = Date.now(); | |
const SYNC_TASK_DELAY = 500; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function waitfunction() { | |
var a = 5000 + new date().gettime(); | |
while (new date() < a){} | |
console.log('waitfunction() context will be popped after this line'); | |
} | |
const bar = () => { | |
setTimeout(() => { | |
console.log('timeout fired') | |
}, 0) // execute now |