R3 icon indicating copy to clipboard operation
R3 copied to clipboard

Debounce does not work in wpf

Open NeverMorewd opened this issue 1 year ago • 1 comments

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

NeverMorewd avatar Apr 17 '24 09:04 NeverMorewd

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}"));
        }

NeverMorewd avatar Apr 17 '24 09:04 NeverMorewd