I have a project where I need to send a status message every 10 seconds unless there\'s been an update in the meantime. Meaning, every time there would be an update, the tim
I keep this little helper method with me:
public static IObservable CreateAutoResetInterval(IObservable resetter, TimeSpan timeSpan, bool immediate = false)
{
return resetter.Select(_ => immediate ? Observable.Interval(timeSpan).StartWith(0) : Observable.Interval(timeSpan)).Switch();
}
It's basically the same mechanism as Enigmativity's answer