angelnikolov / ts-cacheable

Observable/Promise Cache Decorator
https://npmjs.com/package/ts-cacheable
ISC License
340 stars 42 forks source link

How do I bust all caches #22

Closed jlfeld1 closed 5 years ago

jlfeld1 commented 5 years ago

I really like this library. The one potential deal-breaker for me is that there doesn't seem to be any way to bust all caches (like on logout.)

Am I missing this this functionality?

angelnikolov commented 5 years ago

@jlfeld1 I remember that I had something like globalCacheBusterNotifier in mind and even implemented parts of it, but will need to check it out. Give me a week and you will have it :) The API will just be a subject exported out of the cacheable.decorator.ts which will be integrated in every decorator instance and be used to get rid of every in-memory cache.

angelnikolov commented 5 years ago

@jlfeld1 You will find the required behaviour in 1.0.9 which I just published. I've also updated the README with an example of how to use that functionality. Let me know if you have any questions.

rafaelfgx commented 5 years ago

@angelnikolov, nice work!!!

jlfeld1 commented 5 years ago

@angelnikolov, Looks great. thanks!