Releases: knightburton/react-hooks-toolkit
Releases · knightburton/react-hooks-toolkit
v1.1.0
- Introduce the new
debounceFunction
hook feature.
// declaration
const useDebounceFunction = (callback: () => void, delay = 500): (() => void) = {};
// example
const debouncedLog = useDebounceFunction(console.log);
// non relevant lines of code goes here...
// then
debouncedLog('You know the question...', 42);
- Enhance the existing hooks that using
setInterval
orsetTimeout
.
Now all of those usinguseRef
to track thetimeoudId
orintervalId
.
v1.0.0
Reset error and data in useFetch in case of cross action