Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/core/deno/next-tick.ts
3583 views
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
11
export const nextTick = (callback: () => void) => {
12
// use setTimeout to emulate nextTick
13
setTimeout(callback, 16); // 16ms is 1 frame at 60fps
14
};
15
16