1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 21:39:40 +02:00
portainer/app/react/components/datatables/extend-options/mergeOptions.ts

10 lines
327 B
TypeScript

import { TableOptions } from '@tanstack/react-table';
type OptionExtender<T> = (options: TableOptions<T>) => TableOptions<T>;
export function mergeOptions<T>(
...extenders: Array<OptionExtender<T>>
): OptionExtender<T> {
return (options: TableOptions<T>) =>
extenders.reduce((acc, option) => option(acc), options);
}