An open API service indexing awesome lists of open source software.

https://github.com/ludvigalden/use-cleared-memo

React hook for clearing memoized values on unmount and when deps change.
https://github.com/ludvigalden/use-cleared-memo

clearing hooks hydration memoization react

Last synced: 3 months ago
JSON representation

React hook for clearing memoized values on unmount and when deps change.

Awesome Lists containing this project

README

        

[![Stable Release](https://img.shields.io/npm/v/use-cleared-memo.svg)](https://npm.im/use-cleared-memo)
[![Types Included](https://badgen.net/npm/types/use-cleared-memo)](https://npm.im/use-cleared-memo)
[![GZip Size](https://badgen.net/bundlephobia/minzip/use-cleared-mempo)](https://npm.im/use-cleared-memo)
[![Treeshaking](https://badgen.net/bundlephobia/tree-shaking/use-cleared-memo)](https://npm.im/use-cleared-memo)
[![Blazing Fast](https://badgen.now.sh/badge/speed/blazing%20%F0%9F%94%A5/green)](https://npm.im/use-cleared-memo)
[![license](https://badgen.now.sh/badge/license/MIT)](./LICENSE)

---

Are you building a hook or functional React component that needs to predictably clear and/or hydrate memoized values in an easy-to-use way? Opportunities are almost endless; no matter if you're subscribing to external state, initializing timers or intervals, or creating a new instance of some object every time deps change that eventually needs to be deconstructed, `useClearedMemo` will be there for you to do the job.

{{>main}}

## Authors

- Ludvig Aldén [@ludvigalden](https://github.com/ludvigalden)

---

[MIT License.](https://github.com/ludvigalden/use-cleared-memo/blob/main/LICENSE)