observer and observable code example
Example 1: java observable to observer
setChanged();
notifyObservers(object_to_send_to_observer);
Example 2: understanding Observable.create(
import { Observable } from "rxjs/Observable";
var observable = Observable.create(function subscribe(observer) {
observer.next('Hey guys!')
})
// OR
var observable = Observable.create((observer:any) => {
observer.next('Hey guys!')
})