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

memoryUsageWeigher missing from exports #125

Open
elshize opened this issue Jan 26, 2023 · 1 comment
Open

memoryUsageWeigher missing from exports #125

elshize opened this issue Jan 26, 2023 · 1 comment

Comments

@elshize
Copy link

elshize commented Jan 26, 2023

Hi, the docs mention memoryUsageWeigher, but I cannot find it in the entire repository except the readme. I looked through some old issues and commits, and looks like it was here at one point, but was left out when moving to TS, but can't be sure why and what happened. Or else the documentation needs to be updated...

@ivan-kleshnin
Copy link

ivan-kleshnin commented Dec 6, 2023

It's called memoryEstimator in the latest version. Regardless, this functionality seems to be broken:

.withWeigher((_key, value) => {
    return value.length // setting "json" to cache -> weightedSize = 4
  })

.withWeigher((_key, value) => {
    return 32 // setting "json" to cache -> weightedSize = 0 (not 32)
  })

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