javascript - Using cache operator for Observables -




i following tutorials angular-university , in video suggest use cache() operator avoid multiple requests. tried following:

this.posts$ = this.postsservice.savepost(post)     .switchmap(() => this.postsservice.getposts())     .publishreplay(1)     .refcount(); 

and works prefer cache() instead of publishreplay naive way achieve is:

this.postsservice.savepost(post)     .subscribe(() => this.postsservice.getposts()) 

but not kind of reactive.

so prefer use cache not find on add operators.

currently using rxjs: 5.4.3.

so, cache supported version using?

cache gone of version 5.0.0 according the changlog





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -