1/* 2 * next-tick.ts 3 * 4 * Copyright (C) 2023 Posit Software, PBC 5 */ 6 7// we currently hack nextTick through setTimeout because we don't 8// want to have to import from node and the first hack attempt didn't work. 9// (Deno as any)[(Deno as any).internal].core.setNextTickCallback; 10 11export const nextTick = (callback: () => void) => { 12 // use setTimeout to emulate nextTick 13 setTimeout(callback, 16); // 16ms is 1 frame at 60fps 14}; 15 16