# CustomAggFunc

> _Since v1.31.0_

Custom aggregation function that receives an array of numeric values
and returns a single aggregated result.

```ts
type CustomAggFunc = (values: number[]) => number
```

#### Example

```typescript
const weightedAvg: CustomAggFunc = (values) => {
  const total = values.reduce((a, b) => a + b, 0);
  return total / values.length;
};
```
