Something went wrong. Try again.
Bluesky app fork with some witchin' additions 馃挮
Something went wrong. Try again.
431 B 路 14 lines
TypeScript
at main
123456789101112131415import {useEffect, useState} from 'react'
export function useDelayedLoading(delay: number, isActuallyLoading: boolean) { const [isDelayActive, setIsDelayActive] = useState(isActuallyLoading)
useEffect(() => { if (!isDelayActive) return
const timeout = setTimeout(() => setIsDelayActive(false), delay) return () => clearTimeout(timeout) }, [isDelayActive, delay])
return isDelayActive || isActuallyLoading}