useCreation

A React Hook that creates a memoized value that only re-create when the dependencies change.

Demo

Source
{"name":"Bob","age":"61","hobby":"coding"}
Count:
0
DepCount:
0

Usage

See API for more details.

Source

Click links below to view source on GitHub.

API

const value = useCreation(factoryFn, deps)

FactoryFn

A function that returns the value to memoize.

Deps

An array of dependencies that trigger the re-creation of the memoized value.