R3
R3 copied to clipboard
Debounce does not work in wpf
Codes as below
Observable.EveryValueChanged(this, _ => System.Windows.Forms.Cursor.Position)
.Debounce(TimeSpan.FromSeconds(2))
.Subscribe(p =>
{
Console.WriteLine($"point=({p.X},{p.Y})");
});
Console.WriteLine() can not be tiggered.
In addition, the ThrottleFirst worked as the expectation of Debounce
R3.Wpf
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
//https://github.com/Cysharp/R3?tab=readme-ov-file#wpf
WpfProviderInitializer.SetDefaultObservableSystem(ex => Debug.WriteLine($"R3 UnhandledException:{ex}"));
}