derived properties from Observables Command: an abstraction to invoke and marshal an asynchronous method Observable Lists: mutable lists whose changes can be Observed
= new ReactiveList<Tweet>(); IReactiveDerivedList<TweetTileViewModel> TweetTiles; IReactiveDerivedList<TweetTileViewModel> VisibleTiles; public TweetsListViewModel() { TweetTiles = Tweets.CreateDerivedCollection( x => new TweetTileViewModel() { Model = x }, x => true, x => x.CreatedAt); VisibleTiles = TweetTiles.CreateDerivedCollection( x => x, x => !x.IsHidden); } }
(i.e. Behaviors) · Elm helps you with scheduling and ordering, Rx makes you think about it explicitly · Elm disallows signals-of-signals, Rx lets you use them (but doesn't provide any help with it)
a certain amount of time. // NB: The logic here is, "Show the flash for at *least* 5 // seconds. If the user does any UI action after that, *or* // it's been a super long time, dismiss the flash" Observable.Timer(TimeSpan.FromSeconds(5.0), RxApp.MainThreadScheduler) .SelectMany(_ => Observable.Amb( anyUIAction.Take(1), Observable.Timer(TimeSpan.FromSeconds(20.0), RxApp.MainThreadScheduler).SelectUnit())) .TakeUntil(ex.DoUndo) .Where(x => ex.Ok.CanExecute(null)) .Subscribe(_ => ex.Ok.Execute(null));