Cysharp / ObservableCollections

High performance observable collections and synchronized views, for WPF, Blazor, Unity.
MIT License
606 stars 46 forks source link

Add IReadOnlyObservableDictionary interface and ObservableDictionaryR3Extensions #45

Closed TORISOUP closed 5 months ago

TORISOUP commented 5 months ago

1: Add IReadOnlyObservableDictionary

When ObservableDictionary is used in place of UniRx.ReactiveDictionary, I often want an interface equivalent to IReadonlyReactiveDictionary (I want one interface to handle both IReadOnlyDictionary and IObservableCollection).

So I defined IReadOnlyObservableDictionary and ObservableDictionary implements it.

2: Add ObservableDictionaryR3Extensions

When using ObservableDictionary in R3, it is not easy to handle with Observable<KeyValuePair<TKey, TValue>> ( x.Value.Key / x.Value.Value is frequently used and unreadable).

Therefore, I added an extension method that can handle it without KeyValuePair.

neuecc commented 5 months ago

Ok, thanks!