ff_timed_operations library
This library provides classes based on timed operations such as Debounce Throttle operations.
Additionally, it provides optional callbacks to handle different states and outcomes, such as errors, waiting states, null or empty data, and successful completion of the operation.
Debounce limits the rate at which a function can be called by delaying subsequent calls for a specified duration. This can help reduce the number of times a function is called when a user is rapidly firing events, such as typing in a search bar or scrolling. It also handles errors and different states of data, such as waiting, null or empty data.
Throttle limits the frequency at which a function is called by executing it at a regular interval. This can help avoid the overhead of executing a function too frequently, such as sending frequent requests to a server or processing a large amount of data. It also provides options for leading or trailing execution and handles errors and different states of data.
Classes
Typedefs
- OnEmpty = void Function()?
- OnError = void Function(Object error, StackTrace stackTrace)?
- OnNull = void Function()?
-
OnSuccess
= void Function<
T>(T data)? - OnThrottle = void Function()?
- OnTimeout = void Function()?
- OnWaiting = void Function()?