Closed MikeRyanDev closed 7 years ago
I'm not sure if I have an opinion on this, but I'm here to mention that the distinctSelector
doesn't do the same thing as ngrx/store's or ng2-redux's select
.
Rather than selecting a single (optionally nested) property, it extracts a set of properties in an emitted object and only emits when one of these changes. So it basically selects a sub-set of an object and applies a reference equality check to each property.
closing as inactive
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
In a couple of "state as an observable" libraries there is an implementation of an operator typically called something like
select
that acts like an alias formap(fn).distinctUntilChanged()
orpluck(...keys).distinctUntilChanged()
.See: ngrx/store: https://github.com/ngrx/core/blob/master/lib/operator/select.ts ng2-redux: https://github.com/angular-redux/ng2-redux/blob/master/src/components/ng-redux.ts#L105 fluorine: https://github.com/philpl/fluorine/blob/master/src/distinctSelector.js
It would be great if a common, consistent version of this operator were in rxjs proper.
cc @robwormald @SethDavenport @e-schultz @philpl