overleaf/services/web/frontend/js/utils/functions.ts

7 lines
174 B
TypeScript
Raw Normal View History

export function callFnsInSequence<
Args,
Fn extends ((...args: Args[]) => void) | void
>(...fns: Fn[]) {
return (...args: Args[]) => fns.forEach(fn => fn?.(...args))
}