Skip to main content
AsyncResource.bind - node__async_hooks.d.ts - Node documentation
method AsyncResource.bind

Usage in Deno

```typescript import { AsyncResource } from "node:node__async_hooks.d.ts"; ```
AsyncResource.bind<
Func extends (
this: ThisArg,
...args: any[],
) => any
,
ThisArg,
>
(
fn: Func,
type?: string,
thisArg?: ThisArg,
): Func
Binds the given function to the current execution context.

Type Parameters

Func extends (
this: ThisArg,
...args: any[],
) => any
ThisArg

Parameters

fn: Func
The function to bind to the current execution context.
optional
type: string
An optional name to associate with the underlying `AsyncResource`.
optional
thisArg: ThisArg

Return Type