C:\Users\MSI\Desktop\frontend\coresync-react
This commit is contained in:
commit
d8dad2312a
8617 files changed
+1017114
No files matched your search
+10
@@ -0,0 +1,10 @@
|
||||
// @flow
|
||||
|
||||
export default function memoize<V>(fn: string => V): string => V {
|
||||
const cache = {}
|
||||
|
||||
return (arg: string) => {
|
||||
if (cache[arg] === undefined) cache[arg] = fn(arg)
|
||||
return cache[arg]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user