ニジカ投稿局 https://tv.nizika.tv
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

13 lines
353 B

  1. import memoizee from 'memoizee'
  2. export function Memoize (config?: memoizee.Options<any>) {
  3. return function (_target, _key, descriptor: PropertyDescriptor) {
  4. const oldFunction = descriptor.value
  5. const newFunction = memoizee(oldFunction, config)
  6. descriptor.value = function () {
  7. return newFunction.apply(this, arguments)
  8. }
  9. }
  10. }