DebounceMonitoring 1.0.1

📑 Add debounce logic for any method in a single line.

Install-Package DebounceMonitoring -Version 1.0.1
dotnet add package DebounceMonitoring --version 1.0.1
<PackageReference Include="DebounceMonitoring" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DebounceMonitoring --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DebounceMonitoring, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install DebounceMonitoring as a Cake Addin
#addin nuget:?package=DebounceMonitoring&version=1.0.1

// Install DebounceMonitoring as a Cake Tool
#tool nuget:?package=DebounceMonitoring&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Extensions to filter out repeated function calls caused by false or accidental clicks or touches.

  • One-line integration
  • Inlined, no method wrapping
  • Shareable between multiple platforms
  • Automated testing friendly
if (this.DebounceHere()) return;

Rx operator:

button.ClickAsObservable()
    .Debounce()
    .Subscribe(_ => OnButtonClick());

When this.DebounceHere is called, the call time is mapped to its location (method name + line number) and target (this in this case).
On the next call, the time is compared to the stored one. If the interval has not yet passed, then the call is meant to be debounced.
The debounce target (reference) is held weakly, so no memory leaks are caused.

Extensions to filter out repeated function calls caused by false or accidental clicks or touches.

  • One-line integration
  • Inlined, no method wrapping
  • Shareable between multiple platforms
  • Automated testing friendly
if (this.DebounceHere()) return;

Rx operator:

button.ClickAsObservable()
    .Debounce()
    .Subscribe(_ => OnButtonClick());

When this.DebounceHere is called, the call time is mapped to its location (method name + line number) and target (this in this case).
On the next call, the time is compared to the stored one. If the interval has not yet passed, then the call is meant to be debounced.
The debounce target (reference) is held weakly, so no memory leaks are caused.

Release Notes

Thread-safety improvements

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 62 7/5/2021
1.0.0 304 3/10/2021