Latest updates from IceHrmPro
This commit is contained in:
11
web/node_modules/rc-util/es/hooks/useMemo.js
generated
vendored
Normal file
11
web/node_modules/rc-util/es/hooks/useMemo.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as React from 'react';
|
||||
export default function useMemo(getValue, condition, shouldUpdate) {
|
||||
var cacheRef = React.useRef({});
|
||||
|
||||
if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
|
||||
cacheRef.current.value = getValue();
|
||||
cacheRef.current.condition = condition;
|
||||
}
|
||||
|
||||
return cacheRef.current.value;
|
||||
}
|
||||
Reference in New Issue
Block a user