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

x/rimbu/channel/custom/index.ts>attachAbort

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function attachAbort
Re-export
import { attachAbort } from "https://deno.land/x/rimbu@1.2.0/channel/custom/index.ts";

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.

Parameters

signal: AbortSignal | undefined
  • the abort signal to attach the function to
fn: () => void
  • the function to attach to the abort signal

Returns

undefined | (() => void)