Closed angelofb closed 3 months ago
//// ComboBox
public static Observable<SelectionChangedEventArgs> SelectionChangedAsObservable(this ComboBox comboBox, CancellationToken token = default)
{
return Observable.FromEvent<SelectionChangedEventHandler, SelectionChangedEventArgs>(h => (sender, e) => h(e), h => comboBox.SelectionChanged += h, h => comboBox.SelectionChanged -= h, token);
}
Some UI events are useful if the current value is sent at Subscribe time. https://github.com/Cysharp/R3/blob/main/src/R3.Unity/Assets/R3.Unity/Runtime/UnityUIComponentExtensions.cs It is important to be able to properly coordinate such details and to properly cover the components, not just some of them.
thanks to your suggestion I have put together some extensions like you did for stride/unity. if you are interested I can prepare a pull request