Check out example codes for "observable kotlin android". It will help you in understanding the concepts better.

Code Example 1

Observable.just("Apple", "Orange", "Banana")    .subscribe(        { value -> println("Received: $value") }, // onNext        { error -> println("Error: $error") },    // onError        { println("Completed!") }                 // onComplete    )

Learn ReactJs, React Native from akashmittal.com