new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Mantine · all subjects

hooks/use-debounced-state

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

use-debounced-state hook overview

The use-debounced-state hook debounces value changes. It is designed to work with uncontrolled components and can be useful when performing heavy operations based on React state, such as sending a search request.

use-debounced-state vs use-debounced-value

use-debounced-state differs from use-debounced-value in three ways: you do not have direct access to the non-debounced value; it is designed for uncontrolled inputs using defaultValue prop instead of value, so it does not render with every state change like characters typed in an input; and it does not work with custom state providers or props, using useState internally.

use-debounced-state leading option

The use-debounced-state hook supports a leading option. When { leading: true } is passed, the value is immediately updated on the first call.

use-debounced-state function signature

The useDebouncedState function takes a defaultValue of generic type T, a wait time as a number in milliseconds, and optional options. The options parameter accepts UseDebouncedStateOptions which includes an optional leading boolean property. The function returns UseDebouncedStateReturnValue<T>, which is a tuple containing the debounced value and a setter function that accepts SetStateAction<T>.

use-debounced-state type exports

The types UseDebouncedStateOptions and UseDebouncedStateReturnValue can be imported from the @mantine/hooks package.

Give your agent this brain