Closed williamxsp closed 4 years ago
Hey @williamxsp. Thanks for the question. You are on the right path, with the cache buster.
What you need to do so the cache is evicted successfully, is to just decorate your get
method like:
@Cacheable({
cacheBusterObserver: cacheBuster$.asObservable()
})
get(pessoaId): Observable<Array<VideoModel>> {
return of([]).pipe(
switchMap(() => {
return this.http.get(`${this.baseUrl}/${pessoaId}`);
})
);
}
Also, is there a reason that you need this of([])
and a switchMap
?
@williamxsp 🏓
Thanks @angelnikolov . Sorry for the late reply :)
When I save some data Id like that my informations get updated automatically. Im doing the following:
But im not sure if this is the best way to accomplish this. Do you have any idea?