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

x/froebel/function.ts>callAll

A strictly typed utility library.
Latest
variable callAll
import { callAll } from "https://deno.land/x/froebel@v0.23.2/function.ts";

Take a list of functions that accept the same parameters and call them all with the provided arguments.

Examples

Example 1

const mult = (a: number, b: number) => a * b
const div  = (a: number, b: number) => a / b

// prints: [8, 2]
console.log( callAll([mult, div], 4, 2) )

type

<P extends any[], F extends λ<P>[]>(funs: [...F], ...args: P) => ReturnTypes<F>