Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ネットに接続されてる間は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