I have the below code.
this.ObservableForProperty(x => x.SelectedDay)
.Throttle(TimeSpan.FromMilliseconds(3600))
.Where(x => SelectedDay != null)
.ObserveOn(CoreWindow.GetForCurrentThread().Dispatcher)
.Subscribe(x => SomeRandomMethod());
Throttle is working great and it will not call SomeRandomMethod until x.SelectedDay has stopped changing. However it is calling it for each time that it has changed.
So i do this:
Change,
Change,
Wait
//SomeRandomMethod called 2 times at end of throttle
Change
Wait
//SomeRandomMethod called 3 times
Change
Change
Change
Wait
//SomeRandomMethod called 6 times.
How can i get it to ignore all previous change events and only get the latest at the time throttle has done it's thing.
So i would like this:
Change
Change
Wait
//SomeRandomMethod called once
Change
Wait
//SomeRandomMethod called once
Change
Change
Change
Wait
//SomeRandomMethod called once