Thursday 18 January 2018

Operator - Distinct



Distinct

suppress duplicate items emitted by an Observable






The Distinct operator filters an Observable by only allowing items through that have not already been emitted.
In some implementations there are variants that allow you to adjust the criteria by which two items are considered “distinct.” In some, there is a variant of the operator that only compares an item against its immediate predecessor for distinctness, thereby filtering only consecutive duplicate items from the sequence.

-------------------------------------------------------------------------

Observable.just(1,2,3,3,4,5,5).distinct().subscribe(System.out::println);

------------------------------------------------------------------------

















22

No comments:

Post a Comment

Calling method Sequencely

1. Execute multiple task sequencly (WAY-1) ------------------------------------------------------------------------------ import io.re...