Skip to content

Instantly share code, notes, and snippets.

@ionoy
Created April 4, 2014 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ionoy/9972042 to your computer and use it in GitHub Desktop.
Save ionoy/9972042 to your computer and use it in GitHub Desktop.
public IObservable<bool> IsConnected
{
get
{
return _connectionSubject.Select(isConnected => {
if (isConnected)
return Telemetry.Buffer(TimeSpan.FromSeconds(2)).Select(l => l.Count > 0);
return Observable.Return(false);
}).Switch();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment