MCPcopy Create free account
hub / github.com/flatlogic/react-material-admin / progress

Function progress

src/pages/progress/Progress.js:11–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 const [completed, setCompleted] = React.useState(0);
10 React.useEffect(() => {
11 function progress() {
12 setCompleted((oldCompleted) => {
13 if (oldCompleted === 100) {
14 return 0;
15 }
16 const diff = Math.random() * 10;
17 return Math.min(oldCompleted + diff, 100);
18 });
19 }
20 const timer = setInterval(progress, 1500);
21 return () => {
22 clearInterval(timer);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected