Rx.Observable.prototype.distinct([keySelector], [keySerializer])
Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
Arguments
[keySelector]
(Function
): A function to compute the comparison key for each element.[keySerializer]
(Function
): Used to serialize the given object into a string for object comparison.
Returns
(Observable
): An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.