Added Statistics calculation
Statistics now show calculated values
This commit is contained in:
parent
fe87374e47
commit
fc0f69dacb
2147 changed files with 141321 additions and 39 deletions
18
node_modules/@mui/x-internals/esm/useRunOnce/useRunOnce.js
generated
vendored
Normal file
18
node_modules/@mui/x-internals/esm/useRunOnce/useRunOnce.js
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import * as React from 'react';
|
||||
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
||||
const noop = () => {};
|
||||
|
||||
/**
|
||||
* Runs an effect once, when `condition` is true.
|
||||
*/
|
||||
export const useRunOnce = (condition, effect) => {
|
||||
const didRun = React.useRef(false);
|
||||
useEnhancedEffect(() => {
|
||||
if (didRun.current || !condition) {
|
||||
return noop;
|
||||
}
|
||||
didRun.current = true;
|
||||
return effect();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [didRun.current || condition]);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue