mirror of
https://github.com/langgenius/dify.git
synced 2026-04-11 06:00:28 -04:00
Co-authored-by: Brian Wang <BrianWang1990@users.noreply.github.com> Co-authored-by: test <test@testdeMac-mini.local> Co-authored-by: BrianWang1990 <512dabing99@163.com> Co-authored-by: Stephen Zhou <hi@hyoban.cc> Co-authored-by: Stephen Zhou <38493346+hyoban@users.noreply.github.com>
11 lines
416 B
TypeScript
11 lines
416 B
TypeScript
import { useCallback as useCallbackFromReact } from 'react'
|
|
|
|
/** @see https://foxact.skk.moe/use-typescript-happy-callback */
|
|
const useTypeScriptHappyCallback: <Args extends unknown[], R>(
|
|
fn: (...args: Args) => R,
|
|
deps: React.DependencyList,
|
|
) => (...args: Args) => R = useCallbackFromReact
|
|
|
|
/** @see https://foxact.skk.moe/use-typescript-happy-callback */
|
|
export const useCallback = useTypeScriptHappyCallback
|