Knowledge Transfer

Tuesday, August 29, 2017

Caching With RxJs Observables In Angular

Caching is important for performance, especially on bandwidth restricted devices and slow networks. In this article we will discuss how to cache http calls using rxjs observables.
Most developers have a good understanding of caching when working with promises, but how can we translate this to observables?
When interacting with observables we typically set up a subscription on the consumer side and react to values coming through the pipe. With http you generally only expect one value since most http calls are single value calls. However, every time you call subscribe on an http observable, the http call will be made again.


Thanks,
Bhaskar

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home