Skip to content

v1.1.0

Latest
Compare
Choose a tag to compare
@knightburton knightburton released this 25 Oct 19:20
· 7 commits to master since this release
  • 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 or setTimeout.
    Now all of those using useRef to track the timeoudId or intervalId.