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

Usage in Deno

```typescript import { AsyncLocalStorage } from "node:node__async_hooks.d.ts"; ```
AsyncLocalStorage.bind<Func extends (...args: any[]) => any>(fn: Func): Func
Binds the given function to the current execution context.

Type Parameters

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

Parameters

fn: Func
The function to bind to the current execution context.

Return Type

A new function that calls `fn` within the captured execution context.