when to use promise and when to use observable code example Example: rxjs promise to observable import { from } from 'rxjs'; const observable = from(promise);