Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
123456789101112131415161718192021import {useCallback} from 'react'
export enum OnceKey { PreferencesThread = 'preferences:thread',}
const called: Record<OnceKey, boolean> = { [OnceKey.PreferencesThread]: false,}
export function useCallOnce(key: OnceKey) { return useCallback( (cb: () => void) => { if (called[key] === true) return called[key] = true cb() }, [key], )}