import { getCurrent } from '../context/CallbackContext' ; export default function useCallback < T extends ( ... args : any [ ] ) => any > ( callback , deps ) { const context = getCurrent ( ) ; return context . add ( callback , deps ) as T ; }