ngneat / cashew

🐿 A flexible and straightforward library that caches HTTP requests in Angular
https://www.netbasal.com
MIT License
682 stars 33 forks source link

Use withCache() in HttpClient.request() #26

Closed alfredo-dotcms closed 4 years ago

alfredo-dotcms commented 4 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

I've seen in the doc that you can use withCache() in HttpClient methods like .get(), .post(), etc. But when trying to be used on .request() https://angular.io/api/common/http/HttpClient#request, is not supported (or maybe I have not found the way)

Expected behavior

Support to use withCache() on .request() method

What is the motivation / use case for changing the behavior?

Being able to use cashew with an abstraction method to do http requests

NetanelBasal commented 4 years ago

It should work the same - request({...withCache()}) or request(method, URL, ...withCache())

alfredo-dotcms commented 4 years ago

thank you @NetanelBasal it worked!