Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/channel/custom/utils/utils.ts

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
import * as rimbu from "https://deno.land/x/rimbu@1.2.1/channel/custom/utils/utils.ts";

Functions

Attaches the given function to the given abort signal if the signal is not undefined or aborted. Returns a cleanup function that will remove the function from the abort signal or undefined in case one of the conditions mentioned earlier prevents the function from being attached.

Returns a promise that will resolve deferred (immediately but not in the current loop).

Returns a random integer between the given min and max (both inclusive).

Returns a four-digit random number that can serve as a sequence number.

Returns a promise that is resolved after the given amount of milliseconds.

Performs the given action function after the given timeoutMs milliseconds, unless the returns cancel function is called before the timer expires.

Interfaces

Utility that can be used to clean up resources after usage.