-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an IObservable<int> ItemCount property to IReactiveList* #431
Comments
@onovotny I realize it's not in the interface but ReactiveList has Seeing how easy it is to get an observable from the Count property itself using |
I think that interfaces for collections are conceptually dumb, so I defer it to @haacked |
Silly question, but isn't it better to never expose concrete details? So in my VM (or anywhere else), it'd only expose an interface. Not only that, but if I wanted better encapsulation, like using the IReadOnlyReactiveList interfaces, those might still want to subscribe to all of the observables in the concrete type. |
Since the IObservable's are already on the underlying collection, it should be as easy as adding them to the interfaces. I can do this and submit a PR if you want. |
If this is already exposed on the underlying collection I see no harm in this. Send a PR. :) |
👍 |
For Classes That Do Stuff, I totally agree, but I look at ReactiveList the same way as I look as "Dictionary" or "string", it's more like a fundamental data structure than a class with a contract. While this is a bit of a stretch, I think that the interfaces generally just get in the way here. The one useful semantic that the interfaces can describe wrt ReactiveList is, "Please don't change this list" (i.e. "read-only for you" semantics). |
I guess I've always been in the camp of never exposing concrete collection types, including |
Make it easy to subscribe to the list count.
The text was updated successfully, but these errors were encountered: