[**@twipped/hooks**](../../README.md) • **Docs**

***

# Function: useEventCallback()

> **useEventCallback**\<`T`\>(`fn`): `T`

Wraps a callback so that the most recent version is always the one invoked.

## Type parameters

• **T** *extends* `Function`

## Parameters

• **fn**: `T`

The callback to wrap

## Returns

`T`

The stable wrapped callback

## Function

useEventCallback

## Source

[hooks/useEventCallback.js:11](https://github.com/Twipped/hooks/blob/main/hooks/useEventCallback.js#L11)
