phanpy/src/utils/mem.js

8 lines
164 B
JavaScript
Raw Normal View History

2023-10-14 15:33:40 +03:00
import moize from 'moize';
window._moize = moize;
2023-10-14 15:33:40 +03:00
export default function mem(fn, opts = {}) {
2023-11-04 14:19:42 +03:00
return moize(fn, { ...opts, maxSize: 50, isDeepEqual: true });
2023-10-14 15:33:40 +03:00
}