close
Skip to main content
This release is versions behind 1.4.0 — the latest version of @std/async.

@std/async@1.3.0
Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score100%
License
MIT
Downloads26,657/wk
Publisheda month ago (1.3.0)

Utilities for asynchronous operations, like delays, debouncing, or pooling

Functions

f
poll<T>(
fn: () => T,
isDone: (result: Awaited<T>) => boolean,
options?: PollOptions
): Promise<Awaited<T>>

Repeatedly calls a function until a condition is met, then returns the result.

Interfaces

I

Options for poll.

  • interval: number

    The interval in milliseconds between each poll.

  • signal: AbortSignal

    Signal used to abort the polling.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/async

Import symbol

import * as mod from "@std/async/poll";
or

Import directly with a jsr specifier

import * as mod from "jsr:@std/async/poll";