mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
server/server -> server/core
This commit is contained in:
parent
114327d4ce
commit
5a3d0650c9
838 changed files with 111 additions and 111 deletions
12
server/core/helpers/memoize.ts
Normal file
12
server/core/helpers/memoize.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
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)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue