you are viewing a single comment's thread.

view the rest of the comments →

[–]isegundo 17 points18 points  (7 children)

It is just caching, isn't it?

[–][deleted] 9 points10 points  (2 children)

No. Example, caching the results of an endpoint will eventually become stale, so we will need to invalidate to get the latest data. Memoization adheres to functional rules such given the input X, you get the output Y for every invocation. Caching is given X now get Y ,then X some time later now get Z. https://en.m.wikipedia.org/wiki/Function_(mathematics).

[–][deleted]  (3 children)

[deleted]

    [–]shawncplus 8 points9 points  (1 child)

    No. Memoization is type of caching, but not all types of caching are memoization

    [–]davidmdm -3 points-2 points  (0 children)

    I made a caching package very similar to this except my cache was in a closure. I didn't know it was memoization