Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/websocket_broadcastchannel/src/fn.ts>safely

Host-wide BroadcastChannel for Deno CLI, backed by WebSockets.
Latest
function safely
import { safely } from "https://deno.land/x/websocket_broadcastchannel@0.8.0/src/fn.ts";

Executes a function, but swallows any errors.

Type Parameters

optional
T = void

Parameters

fn: () => T

the function to execute, and ignore any errors from.

optional
defaultIfError: T | undefined = [UNSUPPORTED]

the value to return if the function throws an error.

Returns

T | undefined