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.
1 lines
1.7 KiB
1 lines
1.7 KiB
{"ast":null,"code":"import { computed, getCurrentInstance } from 'vue';\nimport { memoize } from 'lodash-unified';\nimport memoOne from 'memoize-one';\nconst useCache = () => {\n const vm = getCurrentInstance();\n const props = vm.proxy.$props;\n return computed(() => {\n const _getItemStyleCache = (_, __, ___) => ({});\n return props.perfMode ? memoize(_getItemStyleCache) : memoOne(_getItemStyleCache);\n });\n};\nexport { useCache };","map":{"version":3,"names":["useCache","vm","getCurrentInstance","props","proxy","$props","computed","_getItemStyleCache","_","__","___","perfMode","memoize","memoOne"],"sources":["../../../../../../../packages/components/virtual-list/src/hooks/use-cache.ts"],"sourcesContent":["import { computed, getCurrentInstance } from 'vue'\nimport { memoize } from 'lodash-unified'\nimport memoOne from 'memoize-one'\n\nimport type { VirtualizedProps } from '../props'\n\nexport const useCache = <T>() => {\n const vm = getCurrentInstance()!\n\n const props = vm.proxy!.$props as VirtualizedProps\n\n return computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _getItemStyleCache = (_: any, __: any, ___: any) =>\n ({} as Record<string, T>)\n return props.perfMode\n ? memoize(_getItemStyleCache)\n : memoOne(_getItemStyleCache)\n })\n}\n"],"mappings":";;;AAGY,MAACA,QAAQ,GAAGA,CAAA,KAAM;EAC5B,MAAMC,EAAE,GAAGC,kBAAkB,EAAE;EAC/B,MAAMC,KAAK,GAAGF,EAAE,CAACG,KAAK,CAACC,MAAM;EAC7B,OAAOC,QAAQ,CAAC,MAAM;IACpB,MAAMC,kBAAkB,GAAGA,CAACC,CAAC,EAAEC,EAAE,EAAEC,GAAG,MAAM,EAAE,CAAC;IAC/C,OAAOP,KAAK,CAACQ,QAAQ,GAAGC,OAAO,CAACL,kBAAkB,CAAC,GAAGM,OAAO,CAACN,kBAAkB,CAAC;EACrF,CAAG,CAAC;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|