3490c7b228203d06244d2459a4f86418.json
1.45 KB
{"ast":null,"code":"import * as React from 'react';\nexport default function useMemo(getValue, condition, shouldUpdate) {\n var cacheRef = React.useRef({});\n\n if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {\n cacheRef.current.value = getValue();\n cacheRef.current.condition = condition;\n }\n\n return cacheRef.current.value;\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-util/es/hooks/useMemo.js"],"names":["React","useMemo","getValue","condition","shouldUpdate","cacheRef","useRef","current","value"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,eAAe,SAASC,OAAT,CAAiBC,QAAjB,EAA2BC,SAA3B,EAAsCC,YAAtC,EAAoD;AACjE,MAAIC,QAAQ,GAAGL,KAAK,CAACM,MAAN,CAAa,EAAb,CAAf;;AAEA,MAAI,EAAE,WAAWD,QAAQ,CAACE,OAAtB,KAAkCH,YAAY,CAACC,QAAQ,CAACE,OAAT,CAAiBJ,SAAlB,EAA6BA,SAA7B,CAAlD,EAA2F;AACzFE,IAAAA,QAAQ,CAACE,OAAT,CAAiBC,KAAjB,GAAyBN,QAAQ,EAAjC;AACAG,IAAAA,QAAQ,CAACE,OAAT,CAAiBJ,SAAjB,GAA6BA,SAA7B;AACD;;AAED,SAAOE,QAAQ,CAACE,OAAT,CAAiBC,KAAxB;AACD","sourcesContent":["import * as React from 'react';\nexport default function useMemo(getValue, condition, shouldUpdate) {\n var cacheRef = React.useRef({});\n\n if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {\n cacheRef.current.value = getValue();\n cacheRef.current.condition = condition;\n }\n\n return cacheRef.current.value;\n}"]},"metadata":{},"sourceType":"module"}