Froussios / Intro-To-RxJava

An extensive tutorial on RxJava
2.05k stars 400 forks source link

Observable.just() is a hot observable and not cold observable as mentioned in the doc. #52

Open Ansh1234 opened 6 years ago

Ansh1234 commented 6 years ago

`fun main() { Observable.just(returnInt()) }

fun returnInt() : Int { println("inside return block") return 2; }`

Even without subscribing to the Observable.just(), it prints the statement, which means it is a hot observable and not a cold observable.

rkeazor commented 5 years ago

Observable.just is a cold observable, because the data is produced inside the observable and closed.