mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 02:15:05 +03:00
* test fuma toc * make toc work * ok toc * ui-patterns toc * fix types * cleanup * fix overflow issues * cleanup * fix loading w * Update apps/docs/components/GuidesTableOfContents.tsx * fix prettier * format * install deps * target ES2018 * tweak regex * update docs test snapshots * fix useSubscribeTocRerender
15 lines
349 B
TypeScript
15 lines
349 B
TypeScript
'use client'
|
|
import { useCallback, useRef } from 'react'
|
|
|
|
/**
|
|
* Don't use this, could be deleted anytime.
|
|
*
|
|
* @internal
|
|
*/
|
|
export function useEffectEvent<F extends (...params: never[]) => unknown>(callback: F): F {
|
|
const ref = useRef(callback)
|
|
ref.current = callback
|
|
|
|
return useCallback(((...params) => ref.current(...params)) as F, [])
|
|
}
|