first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
/**
* Modified `useCallback` that returns the same function reference every time, but internally calls
* the most-recently passed callback implementation. Can be useful in situations such as:
* - Event handler dependencies change too frequently, such as user props which might change on
* every render, or volatile values such as useState/useDispatch
* - Callback must be referenced in a captured context (such as a window event handler or unmount
* handler that's registered once) but needs access to the latest props
*
* In general, prefer `useCallback` unless you've encountered one of the problems above.
*
* https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback
*
* @param fn - The callback function that will be used
* @returns A function which is referentially stable but internally calls the most recently passed callback
*/
export declare function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;