create observable from promise code example
Example 1: promise to observable typescript
import { from } from 'rxjs';
const observable = from(promise);
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!')
})