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