![]() |
VOOZH | about |
dotnet add package Soenneker.Utils.Debounce --version 4.0.55
NuGet\Install-Package Soenneker.Utils.Debounce -Version 4.0.55
<PackageReference Include="Soenneker.Utils.Debounce" Version="4.0.55" />
<PackageVersion Include="Soenneker.Utils.Debounce" Version="4.0.55" />Directory.Packages.props
<PackageReference Include="Soenneker.Utils.Debounce" />Project file
paket add Soenneker.Utils.Debounce --version 4.0.55
#r "nuget: Soenneker.Utils.Debounce, 4.0.55"
#:package Soenneker.Utils.Debounce@4.0.55
#addin nuget:?package=Soenneker.Utils.Debounce&version=4.0.55Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.Debounce&version=4.0.55Install as a Cake Tool
π alternate text is missing from this package README image
π alternate text is missing from this package README image
π alternate text is missing from this package README image
π alternate text is missing from this package README image
A utility that lets you debounce work in .NET.
Give it a delay, async/sync delegate, and the Debouncer guarantees that multiple rapid calls collapse into exactly one invocation.
dotnet add package Soenneker.Utils.Debounce
using Soenneker.Utils.Debounce;
var debouncer = new Debouncer();
// Fire only once, 300 ms after the *last* request:
void OnTextChanged(string text)
{
debouncer.Debounce(
delayMs: 300,
action: async ct =>
{
var results = await SearchAsync(text, ct);
UpdateUI(results);
});
}
void OnResize()
{
debouncer.Debounce(
delayMs: 250,
action: () =>
{
// Runs on the thread-pool after 250 ms of quiescence
SaveWindowLayout();
});
}
Pass runLeading: true if you want the first call to run immediately and the trailing call to run after the quiet period:
debouncer.Debounce(
delayMs: 500,
runLeading: true,
action: ct => Logger.LogAsync("Burst started", ct));
Either wrap it in a using statement or dispose the debouncer when youοΏ½re done:
await debouncer.DisposeAsync();
DisposeAsync() waits for any in-flight work to finish, ensuring graceful shutdown.
System.Threading.TimerInterlocked swaps.CancellationToken.Debounce.| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Soenneker.Utils.Debounce:
| Package | Downloads |
|---|---|
|
Soenneker.Quark.Suite
Shadcn-powered Blazor UI, refined and modular. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.55 | 0 | 6/19/2026 |
| 4.0.54 | 0 | 6/19/2026 |
| 4.0.53 | 18 | 6/18/2026 |
| 4.0.52 | 4,342 | 6/6/2026 |
| 4.0.51 | 103 | 6/5/2026 |
| 4.0.49 | 1,782 | 6/5/2026 |
| 4.0.48 | 10,422 | 4/23/2026 |
| 4.0.47 | 110 | 4/22/2026 |
| 4.0.46 | 10,385 | 3/13/2026 |
| 4.0.45 | 147 | 3/13/2026 |
| 4.0.41 | 313 | 3/12/2026 |
| 4.0.40 | 147 | 3/12/2026 |
| 4.0.38 | 760 | 3/11/2026 |
| 4.0.37 | 151 | 3/11/2026 |
| 4.0.36 | 150 | 3/10/2026 |
| 4.0.35 | 135 | 3/10/2026 |
| 4.0.34 | 133 | 3/10/2026 |
| 4.0.33 | 113 | 3/9/2026 |
| 4.0.32 | 657 | 3/9/2026 |
| 4.0.31 | 1,056 | 3/4/2026 |
Update dependency Soenneker.Extensions.Task to 4.0.123 (#267)