abstract memoization to a library
use lru-memoize from npm package