FunctionProxy.debounce constructor

FunctionProxy.debounce(
  1. Function target, {
  2. String? key,
  3. int timeout = 500,
})

Factory constructor to create a debounced function proxy.

target: The function to debounce. key: An optional unique key to identify the debounced function. timeout: The debounce duration in milliseconds (default is 500).

Returns a FunctionProxy instance and immediately applies the debounce logic.

Implementation

factory FunctionProxy.debounce(
  Function target, {
  String? key,
  int timeout = 500,
}) {
  return FunctionProxy(target, timeout: timeout)..debounce(uniqueKey: key);
}