Memoize a function
const square = memo((n: number) => n * n);square(4); // 16, computed and cachedsquare(4); // 16, returned from the cache Copy
const square = memo((n: number) => n * n);square(4); // 16, computed and cachedsquare(4); // 16, returned from the cache
Memoize a function