How to make a function store data to avoid repeating computation

I think this is a mistake. Memoize does exactly what you want and is debugged and can be applied to whatever you want and works with functions that have multiple arguments etc etc. It’s lightweight and should be considered kind of a core package.

3 Likes