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
/* Originally from https://github.com/ahmedalejo/System.Reactive.EventStream/blob/master/src/Extensions/INotifyPropertyChangedExtensions.cs */ | |
// Sample Usage | |
component | |
.ObservePropertyChangedValues(component => component.UXScore) | |
.Throttle(TimeSpan.FromSeconds(1)) | |
.Subscribe(uXScore => Console.WriteLine($"Component's UX-Score is currently '{uxScore}'")); | |
component | |
.ObservePropertyChangedValues() |
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
/** | |
* A class that provides ways for working with async code | |
* ```ts | |
* import { Task } from 'task' | |
* await Task.delay(1000); | |
* ``` | |
*/ | |
export class Task { | |
/** | |
* Creates a Task that will be completed after a time delay. |
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
//Original share here https://github.com/reactiveui/refit/issues/258#issuecomment-243394076 on Aug 30, 2016 | |
//var httpClient = new HttpClient(new HttpLoggingHandler()){ BaseAddress = /**/}; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Threading; |
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
//https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.controls.iqueryattributable | |
void IQueryAttributable.ApplyQueryAttributes(IDictionary<string, string> query) | |
{ | |
if (query.Count == 0) | |
return; | |
JsonConvert.PopulateObject( | |
value: JObject.FromObject(query).ToString(), | |
target:this); | |
} |
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
using static Duration; | |
public class LogginViewModel | |
{ | |
[ReportDuration(LongerThan = 1000)] | |
[ReportDuration("User Login", LongerThan = 1000)] | |
[ReportSlowExecution(LongerThan = FiveSeconds)] | |
async Task<bool> LoginAsync() { ... } | |
} |