FunctionProxy class

A proxy class that provides debouncing functionality for functions.

This class allows you to wrap a function and ensure that it is not called too frequently. When the debounced function is invoked repeatedly within a short period, only the last invocation will be executed after the specified timeout.

Constructors

FunctionProxy.new(Function? target, {int timeout = 0})
Creates a FunctionProxy with the specified target function and timeout.
FunctionProxy.debounce(Function target, {String? key, int timeout = 500})
Factory constructor to create a debounced function proxy.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
target Function?
The target function to be debounced.
final
timeout int
The debounce timeout in milliseconds.
final

Methods

debounce({String? uniqueKey}) → void
Debounce the function call to prevent it from being called too frequently.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited