- who is migrating to RxJava 2
- or just started with RxJava.
Hi, I am Amit Shekhar, I have mentored many developers, and their efforts landed them high-paying tech jobs, helped many tech companies in solving their unique problems, and created many open-source libraries being used by top companies. I am passionate about sharing knowledge through open-source, blogs, and videos.
You can connect with me on:
My Personal Blog - amitshekhar.me - High-quality content to learn Android concepts.
RxJava 2.0 has been completely rewritten from scratch on top of the Reactive-Streams specification. The specification itself has evolved out of RxJava 1.x and provides a common baseline for reactive systems and libraries.
Add this in your build.gradle
compile 'io.reactivex.rxjava2:rxjava:X.X.X'
If you are using RxAndroid also, then add the following
compile 'io.reactivex.rxjava2:rxandroid:X.X.X'
Map
-> transform the items emitted by an Observable by applying a function to each item. Blog: RxJava Operator Map vs FlatMapZip
-> combine the emissions of multiple Observables together via a specified function and emit single items for each combination based on the results of this functionFilter
-> emit only those items from an Observable that pass a predicate testFlatMap
-> transform the items emitted by an Observable into Observables, then flatten the emissions from those into a single Observable. Blog: RxJava Operator Map vs FlatMapTake
-> emit only the first n items emitted by an Observable. Blog for referenceReduce
-> apply a function to each item emitted by an Observable, sequentially, and emit the final valueSkip
-> suppress the first n items emitted by an ObservableBuffer
-> periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting the items one at a timeConcat
-> emit the emissions from two or more Observables without interleaving them. Blog for referenceReplay
-> ensure that all observers see the same sequence of emitted items, even if they subscribe after the Observable has begun emitting itemsMerge
-> combine multiple Observables into one by merging their emissionsSwitchMap
-> transform the items emitted by an Observable into Observables, and mirror those items emitted by the most-recently transformed Observable
-
DisposableExampleActivity- UsingCompositeDisposable
. Blog for reference -
FlowableExampleActivity- UsingFlowable
andreduce
operator -
SingleObserverExampleActivity- UsingSingleObserver
-
CompletableObserverActivity- UsingCompletableObserver
-
MapExampleActivity- Usingmap
Operator. Blog: RxJava Operator Map vs FlatMap -
ZipExampleActivity- Usingzip
Operator -
BufferExampleActivity- Usingbuffer
Operator -
TakeExampleActivity- Usingtake
Operator. Blog for reference -
ReduceExampleActivity- Usingreduce
Operator -
FilterExampleActivity- Usingfilter
Operator -
SkipExampleActivity- Usingskip
Operator -
ReplayExampleActivity- Usingreplay
Operator -
ConcatExampleActivity- Usingconcat
Operator. Blog for reference -
MergeExampleActivity- Usingmerge
Operator -
DeferExampleActivity- Usingdefer
Observable -
SwitchMapExampleActivity- UsingswitchMap
Observable -
IntervalExampleActivity- UsingInterval
. Blog for reference -
@Deprecated RxBusActivity- RxBus, RxJava2Bus, EventBus, RxEventBus -
PaginationActivitysomeTime Can be substituted by Customized View Such as SmartRefreshLayout - Pagination for loadMore in RecyclerView. Blog: Pagination In RecyclerView Using RxJava Operators -
??? ComposeOperatorExampleActivity - Compose operator for reusable
-
Search Implementation - Using
debounce
,switchMap
,distinctUntilChanged
-
Implement Caching Using RxJava Operators- Usingconcat
,firstElement
-
PublishSubjectExampleActivity. Blog: RxJava Subject - Publish, Replay, Behavior, and Async
- Support it by clicking the ⭐ button on the upper right of this page. ✌️
Thanks
You can connect with me on:
Copyright (C) 2022 Amit Shekhar
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Just make pull request. You are in!