Created
January 11, 2012 09:26
-
-
Save mharju/1593894 to your computer and use it in GitHub Desktop.
Invoke timeout after there has been no events in a given timeout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable.FromEvent<MapDragEventArgs>(Map, "MapPan") | |
.Publish(mapPan_ => | |
{ | |
mapPan_.Subscribe( _ => | |
Observable.Timer(TimeSpan.FromMilliseconds(500)) | |
.TakeUntil(mapPan_) | |
.Subscribe(__ => Debug.WriteLine("Timeout")) | |
); | |
return mapPan_; | |
}) | |
.Subscribe(_ => Debug.WriteLine("MapPan")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment