deno.com

function setImmediate

#setImmediate<T = void>(
value?: T,
options?: TimerOptions,
): Promise<T>
import {
  setImmediate,
} from 'node:timers/promises';

const res = await setImmediate('result');

console.log(res);  // Prints 'result'

Type Parameters #

#T = void

Parameters #

#value: T
optional

A value with which the promise is fulfilled.

#options: TimerOptions
optional

Return Type #

Promise<T>