This is a real use case especially while building frontend apps and memoizing the view functions. I would personally want to restrict the cache size to 1 for such cases.
Eg:
const view = (p) => {
return <div>{p.count}</div>
}
const mView = memoize(view)
mView(1) // MISS
mView(2) // MISS
mView(2) // HIT
Generally the view returns really large objects which can cause a significant performance impact if one starts caching all the values.
This is a real use case especially while building frontend apps and memoizing the view functions. I would personally want to restrict the cache size to
1
for such cases.Eg:
Generally the view returns really large objects which can cause a significant performance impact if one starts caching all the values.