blob: aa20e7d737daa4d1fa0a68909ae10c5c53469843 (
plain) (
tree)
|
|
import memoizee from 'memoizee'
export function Memoize (config?: memoizee.Options<any>) {
return function (_target, _key, descriptor: PropertyDescriptor) {
const oldFunction = descriptor.value
const newFunction = memoizee(oldFunction, config)
descriptor.value = function () {
return newFunction.apply(this, arguments)
}
}
}
|