MCPcopy Create free account
hub / github.com/Effect-TS/effect / setMicrotask

Function setMicrotask

packages/effect/src/Scheduler.ts:95–103  ·  view source on GitHub ↗
(f: () => void)

Source from the content-addressed store, hash-verified

93 }
94
95const setMicrotask = (f: () => void) => {
96 let cancelled = false
97 Promise.resolve().then(() => {
98 if (!cancelled) f()
99 })
100 return (): void => {
101 cancelled = true
102 }
103}
104
105class PriorityBuckets {
106 buckets: Array<[priority: number, tasks: Array<() => void>]> = []

Callers

nothing calls this directly

Calls 1

fFunction · 0.50

Tested by

no test coverage detected