Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
at main 16 lines 464 B view raw
1import {useEffect, useState} from 'react' 2 3/** 4 * Returns a debounced version of the input value that only updates after the 5 * specified delay has passed without any changes to the input value. 6 */ 7export function useDebouncedValue<T>(val: T, delayMs: number): T { 8 const [prev, setPrev] = useState(val) 9 10 useEffect(() => { 11 const timeout = setTimeout(() => setPrev(val), delayMs) 12 return () => clearTimeout(timeout) 13 }, [val, delayMs]) 14 15 return prev 16}