useDebounce and useThrottle return a wrapped function, but the names do not say so, and other hook libraries use the same names for hooks that return a debounced or throttled value. useDebouncedCallback and useThrottledCallback cannot replace them yet, because they forward a single value and have no cancel.
- Let
useDebouncedCallback and useThrottledCallback wrap a function with any arguments and return it with cancel.
- Mark
useDebounce and useThrottle as deprecated and point their docs to the Callback hooks.
useImpressionRef relies on the Callback hook skipping a repeated call with the same value. Keep that behavior, either in the Callback hook or in useImpressionRef.
Update types, docs, and tests.
Waits for #530 and #534.
useDebounceanduseThrottlereturn a wrapped function, but the names do not say so, and other hook libraries use the same names for hooks that return a debounced or throttled value.useDebouncedCallbackanduseThrottledCallbackcannot replace them yet, because they forward a single value and have nocancel.useDebouncedCallbackanduseThrottledCallbackwrap a function with any arguments and return it withcancel.useDebounceanduseThrottleas deprecated and point their docs to the Callback hooks.useImpressionRefrelies on the Callback hook skipping a repeated call with the same value. Keep that behavior, either in the Callback hook or inuseImpressionRef.Update types, docs, and tests.
Waits for #530 and #534.