Skip to content

Instantly share code, notes, and snippets.

View jcb121's full-sized avatar

Jesse Baker jcb121

  • Prague
View GitHub Profile
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;
@jcb121
jcb121 / Test.js
Last active October 25, 2021 21:07
SetTimeout
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