Created
February 9, 2015 12:02
-
-
Save runceel/28118c56e008c592a361 to your computer and use it in GitHub Desktop.
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
// ネットに接続されてる間はtrueとか | |
var connected = new BooleanNotifier(); | |
// ダウンロード中はtrueとか | |
var downloading = new BooleanNotfier(); | |
var command = new[] | |
{ | |
connected, | |
downloading.Select(x => !x) | |
} | |
.CombineLatest(x => x.All(x => x)) | |
.ToReactiveCommand(); | |
command.Subscribe(_ => | |
{ | |
downloading.SwitchValue(); | |
await ダウンロードAsync(); | |
downloading.SwitchValue(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment