> ## Documentation Index
> Fetch the complete documentation index at: https://resq-dependabot-github-actions-github-actions-478e18be3d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CompareFn

# Type Alias: CompareFn\<T>

> **CompareFn**\<`T`> = (`a`, `b`) => `number`

Defined in: [priority-queue.ts:38](https://github.com/resq-software/npm/blob/fe2e20ae9db8398a0db1e3218edaabb3cf7004d6/packages/dsa/src/priority-queue.ts#L38)

Comparison function for priority queue ordering
Returns negative if a has higher priority, positive if b has higher priority, 0 if equal

## Type Parameters

### T

`T`

## Parameters

### a

`T`

### b

`T`

## Returns

`number`
