DEV Community

loading...

Discussion on: You should not use lodash for memoization

Collapse
josuevalrob profile image
Josue Valenica

Thanks for your post, Adrien.
Btw, I don't think it is bad that the memoize function just cache the first key.

Lodash was concibed to work with functional programming patterns. So technically, you don't have functions with more than one param. Curried functions just accept one input. (in most cases)

Also, if we go back to the functional programming principles, you don't need to set a lifetime for your values. If you are working with pure functions, they always will be the same, for the same input, same output.