Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am zacharyyates on github.
  • I am zacharyyates (https://keybase.io/zacharyyates) on keybase.
  • I have a public key ASAQqMiH-XzG6UePIRLoSLfMFcExpKGg0I2hVTYR2TzSRwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am zacharyyates on github.
  • I am zacharyyates (https://keybase.io/zacharyyates) on keybase.
  • I have a public key whose fingerprint is D8F9 315F 3A2C 313B EC5A 2677 BAC7 8BDE DC71 A6D0

To claim this, I am signing this object:

@zacharyyates
zacharyyates / Events.cs
Last active March 24, 2017 01:24
A basic event debouncer for .NET, similar to http://underscorejs.org/#debounce
using System;
using System.Collections.Generic;
using System.Timers;
public static class Events {
static Dictionary<EventHandler, Timer> _debounceTimers;
public static EventHandler Debounce(TimeSpan interval, Action<object, EventArgs> action, ISynchronizeInvoke synchronizingObject = null) {
object lastSender = null;
EventArgs lastArgs = null;