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

How to get the maxSize of a cache instance? #47

Closed
tbontb-iaq opened this issue Sep 11, 2023 · 2 comments
Closed

How to get the maxSize of a cache instance? #47

tbontb-iaq opened this issue Sep 11, 2023 · 2 comments

Comments

@tbontb-iaq
Copy link

const cache = new QuickLRU({ maxSize: 10 });

/// cache.maxSize ???

When using resize to update maxSize, you may need to compare the new and old maxSizes.

@tbontb-iaq
Copy link
Author

Quick job.
It can be obtained through maxSize, but it must be set through resize.
Is it better to define the getter and setter for maxSize?

@sindresorhus
Copy link
Owner

Yeah, not worth removing resize, but we could make maxSize setter just call it internally.

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

2 participants