Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keys() writes checks that get() can't cash #92

Open
haphut opened this issue Nov 7, 2017 · 0 comments
Open

keys() writes checks that get() can't cash #92

haphut opened this issue Nov 7, 2017 · 0 comments

Comments

@haphut
Copy link

haphut commented Nov 7, 2017

I'd like to do something like this:

const values = cache.keys().map((key) => cache.get(key));

Based on the documentation, I expect:

  • that values does not contain any nulls if I had not inserted any into cache,
  • that cache does not delete elements while timers do not have a chance to run and
  • that a function named get does not delete elements.

Currently memory-cache deletes elements both with timers and as a side-effect within get among other methods. I think it would be helpful to write such design decisions high up in the README. The API description of get in the README does not explain this behavior. The uncertainty in the result of del is the only hint about side-effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant