overleaf/services/web/frontend/js/utils/functions.ts
Alf Eaton 6cc2db3cdd Merge pull request #17525 from overleaf/ae-upgrade-prettier
Upgrade Prettier to v3

GitOrigin-RevId: 6f1338f196408f3edb4892d5220ad3665ff1a5bc
2024-03-26 09:04:05 +00:00

6 lines
175 B
TypeScript

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