Learn By Doing Android, Diving into RxJava & RxAndroid (PublishSubject, Map, Function And Debounce)


Consider the Observable to be a Musician(emitter) and the audience as the Observer(consumer). In this case the subject will act like a tape recorder with player. It can listen(observe/record) to the singer and can also play(emit) like an observable. You can also add new songs from some other artist onto it.

.map(x -> x * x)
private PublishSubject<String> mPublishSubject;
private CompositeDisposable disposables;
//Add this line
.debounce(400, TimeUnit.MILLISECONDS)



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store