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

feat: add local parameter codec override #16

Closed mokipedia closed 4 years ago

mokipedia commented 4 years ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

Adds the possibility to override parameter codec per request

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

ParameterCodec can be set globally for all requests

What is the new behavior?

parameterCodec$ in params will override encoder for HttpParams per request

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Other information

Note: no tests as I was unable to find a reliable way to programatically test request after interceptor. Input wanted!

NetanelBasal commented 4 years ago

Please add tests. You can learn from the current specs.

itayod commented 4 years ago

@mokipedia LGTM, great work!