By using Http, we call a method that does a network call and returns an http observable:
getCustomer() { return
according to this article
It turns out we can easily add caching to the observable by adding publishReplay(1) and refCount.
so inside if statements just append
.publishReplay(1) .refCount();
to .map(...)
.map(...)