ngx-cache
ngx-cache copied to clipboard
returnType not exposed, so can't set custom lifespan on cache items
I'm submitting a ... (check one with "x")
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
Current behavior The ReturnType model is not exposed to index.ts so can't be directly used by a calling model. Given that ReturnType comes before lifespan in CacheService.set this makes it so a user can't set the lifespan without mocking the ReturnType
Expected/desired behavior ReturnType should be exposed and/or the lifespan definition should come before the returnType in CacheService.set so that lifespan is accessible.
Minimal reproduction of the problem with instructions No reproduction needed as this a bug in the public api
What is the motivation / use case for changing the behavior? Need the ability to use CacheService.set with a custom lifespan for short lived items.
Environment
- Angular version: 5.x
-
Browser: N/A
-
For Tooling issues: N/A
-
Others: Note while I'm aware I can hack around this, the correct behavior would be to allow the developer access to the ReturnType model.
@paullryan sorry for the delay, had busy times. feel free to fire a PR and i'll approve.