Cysharp / ObservableCollections

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

Add IReadOnlyObservableDictionary interface and ObservableDictionaryR3Extensions #45

Closed TORISOUP closed 4 weeks ago

TORISOUP commented 1 month 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 4 weeks ago

Ok, thanks!