Blame view

node_modules/bootstrap-vue/src/utils/memoize.js 236 Bytes
4cd4fd28   郭伟龙   feat: 初始化项目
1
2
3
4
5
6
7
8
9
10
import { create } from './object'

export const memoize = fn => {
  const cache = create(null)

  return (...args) => {
    const argsKey = JSON.stringify(args)
    return (cache[argsKey] = cache[argsKey] || fn.apply(null, args))
  }
}