Rate limit your actions by throttling and debouncing them.
$ dotnet add package DotNetCore.DebounceThrotteThis library is inspired by jquery-throttle-debounce. Most of the DotNet libraries about debounce/throttle is used into WPF. In my Blazor project, I hope to use this library to improve the performance of my application. In this library, that can be used to throttle and debounce.
Demonstrate how to use the throttle in code.
var throttle = ThrottleDebounce.Throttle(action, 200);
while(true)
{
throttle();
await Task.Delay(100);
}
Demonstrate how to use the debounce in code.
var debounce = ThrottleDebounce.Debounce(action, 200);
while(true)
{
debounce();
await Task.Delay(100);
}