# @react-hookbox/event-callback

> Material UI's useEventCallback with better type definitions.

Latest version **1.3.0** (published 2021-12-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @react-hookbox/event-callback
pnpm add @react-hookbox/event-callback
yarn add @react-hookbox/event-callback
bun add @react-hookbox/event-callback
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2021-12-15 |
| First published | 2021-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | hakobpogh |
| Maintainers | hakobpogh |
| Keywords | @react-hookbox, @react-hookbox/event-callback, event-callback-hook, useEventCallback |

## Links

- npm: https://www.npmjs.com/package/@react-hookbox/event-callback
- Repository: https://github.com/react-hookbox/event-callback
- npm.io page: https://npm.io/package/@react-hookbox/event-callback

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.3.0 (latest) — 2021-12-15
- 1.2.0 — 2021-08-11
- 1.1.3 — 2021-08-07
- 1.1.2 — 2021-08-07
- 1.1.1 — 2021-08-07
- 1.1.0 — 2021-08-07
- 1.0.2 — 2021-07-28
- 1.0.1 — 2021-07-27
- 1.0.0 — 2021-07-27

## README

# @react-hookbox/event-callback

> Material UI's useEventCallback with better type definitions.

[![NPM][npm-image]][npm-link]
[![Minzipped Bundle Size][bundlephobia-image]][bundlephobia-link]

## Install

```bash
npm install --save @react-hookbox/event-callback
```
or
```bash
yarn add @react-hookbox/event-callback
```


## Usage

both for JavaScript and Typescript:
```typescript
import { useEventCallback } from '@react-hookbox/event-callback';
// OR
// import useEventCallback from '@react-hookbox/event-callback';

// then
const myCallback = useEventCallback((num, str) => {
  return str.repeat(Math.min(num, 2));
});
```

`useEventCallback` updates the callback it's using after
an "effective-time". So make sure to use it as a callback
or in a `useEffect` which is placed after `useEventCallback`;

## Params

* `fn`. This is a required function parameter.
  The returned value will have the same type.

  > ***Note:*** The return value will be updated after an
  "effect-ive time".

  That means the returned value should be used as an event
  callback or in an event callback.

## License

MIT © [hakobpogh][github-hakobpogh]

[npm-image]: https://img.shields.io/npm/v/@react-hookbox/event-callback.svg
[npm-link]: https://www.npmjs.com/package/@react-hookbox/event-callback
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@react-hookbox/event-callback
[bundlephobia-link]: https://bundlephobia.com/result?p=@react-hookbox/event-callback
[github-hakobpogh]: https://github.com/hakobpogh

---
_Source: https://npm.io/package/@react-hookbox/event-callback · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
