Engrain by ByteRush

RCT.12 8 concepts

The custom-hooks round

Implement common custom hooks under interview conditions, with correct cleanup and stable identities.

  1. RCT.12.01Method and testing hooksCoreMid-levelBeing written
  2. RCT.12.02useDebounce, useThrottle, usePrevious, useToggleCoreMid-levelBeing written
  3. RCT.12.03useFetch / useAsync with abort and cacheCoreMid-levelBeing written
  4. RCT.12.04useLocalStorage, useMediaQuery, useOnlineStatusCoreMid-levelBeing written
  5. RCT.12.05useInterval, useTimeout, useEventListener, useClickOutsideCoreMid-levelBeing written
  6. RCT.12.06useIntersectionObserver, useInfiniteScroll, useWindowSizeMid-levelBeing written
  7. RCT.12.07useUndoRedo, useForm (mini), useStateWithHistorySeniorBeing written
  8. RCT.12.08More hooks: clipboard, hover, hotkeys, script, focus trap, countdownMid-levelBeing written

Interview questions in this module

  1. Implement useDebounce.
  2. Implement useFetch that cancels stale requests.
  3. Implement usePrevious.
  4. Implement useLocalStorage that syncs across tabs.
  5. Implement useInterval that always calls the latest callback.
  6. Implement useClickOutside.
  7. Implement useUndoRedo.
  8. How do you test a custom hook?