123456789101112131415161718192021222324252627282930313233 |
- "use strict";
- const memoize = fn => {
- let cache = false;
-
- let result;
- return () => {
- if (cache) {
- return (result);
- }
- result = fn();
- cache = true;
-
-
-
- (fn) = undefined;
- return (result);
- };
- };
- module.exports = memoize;
|