1. 程式人生 > >RxJava2 Flowable distinct(過濾操作符)

RxJava2 Flowable distinct(過濾操作符)

distinct(Function<? super T,K> keySelector)

Returns a Flowable that emits all items emitted by the source Publisher that are distinct according to a key selector function and based on Object.equals(Object) comparison of the objects returned by the key selector function.

返回一個Flowable,它根據鍵選擇器函式並基於對鍵選擇器函式返回的物件的Object.equals(Object)比較,發出源Publisher發出的所有專案。