File size: 218 Bytes
1e92f2d
 
 
 
 
 
 
1
2
3
4
5
6
7
8
import type { AnyFunction } from "./types"

export function callAll<T extends AnyFunction>(...fns: (T | undefined)[]) {
  return function mergedFn(...args: Parameters<T>) {
    fns.forEach((fn) => fn?.(...args))
  }
}