This file contains hidden or 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
public static class HttpClientRxMixins | |
{ | |
public static IObservable<T> RequestAsync<T>(this HttpClient This, string requestUri) | |
{ | |
return This.GetAsync(requestUri).ToObservable() | |
.ThrowOnRestResponseFailure() | |
.SelectMany(x => x.Content.ReadAsStringAsync().ToObservable()) | |
.SelectMany(x => JsonConvert.DeserializeObjectAsync<T>(x).ToObservable()); | |
} |
This file contains hidden or 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
public static class Extensions | |
{ | |
public static IObservable<TProperty> ObservePropertyChanged<TNotifier, TProperty>( | |
this TNotifier notifier, | |
Expression<Func<TNotifier, TProperty>> propertyAccessor, | |
bool startWithCurrent = false) | |
where TNotifier : INotifyPropertyChanged | |
{ | |
// Parse the expression to find the correct property name. |
NewerOlder