mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 09:50:33 -04:00
c69ac64ad5
* docs: update custom domain docs for verification process * fix: ensure the ui experience for custom domains matches the flow * chore: prettier formatting fixes * docs: only reference a single txt record for custom domains * fix: drop undefined from dns table type * automatically poll for custom domain ssl status * Minor UI tweaks --------- Co-authored-by: Alaister Young <a@alaisteryoung.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
24 lines
447 B
TypeScript
24 lines
447 B
TypeScript
import { useEffect, useRef } from 'react'
|
|
|
|
export function useInterval(callback: () => void, delay: number | false) {
|
|
const savedCallback = useRef(callback)
|
|
|
|
useEffect(() => {
|
|
savedCallback.current = callback
|
|
}, [callback])
|
|
|
|
useEffect(() => {
|
|
if (delay === false) {
|
|
return
|
|
}
|
|
|
|
const id = setInterval(() => {
|
|
savedCallback.current()
|
|
}, delay)
|
|
|
|
return () => {
|
|
clearInterval(id)
|
|
}
|
|
}, [delay])
|
|
}
|