ngneat / cashew

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

Allow numeric values as keys #100

Closed Laurens-makel closed 10 months ago

Laurens-makel commented 10 months 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

The following is not accepted syntax

const someId = 0;
withCache({ key: someId })

forcing me to use withCache({ key: `${someId}` }) or withCache({ key: ''+someId })

Expected behavior

This syntax to be accepted

const someId = 0;
withCache({ key: someId })

Minimal reproduction of the problem with instructions

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

Developer experience

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: XX  
- Platform:  

Others:

NetanelBasal commented 10 months ago

You're welcome to submit a PR