I’m trying to tame a keyboard triggered event that without throttling would fire with a very high frequency. The code below works but it also delays the first invocation of GlobalCopy by the throttling timespan. Is there a way to get the first sample without delay?
observableGlobalCopy = Observable
.FromEventPattern<EventHandler, EventArgs>(h => this.GlobalCopy += h, h => this.GlobalCopy -= h);
observableGlobalCopy
.SubscribeOnDispatcher()
.Throttle(GlobalEventThottle)
.Subscribe(x => GlobalCopyHandler());
You could try something like this: