Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game bet
- useEffect(() => {
- const timer = setTimeout(() => {
- const newData = data.map((el) => {
- const randomValue = Math.random() * 1;
- const newValue = Math.random() < 1 ? Number(el.oddUI) + randomValue : Number(el.oddUI) - randomValue;
- const roundedValue = Math.round(newValue);
- const newItem = { ...el, oddUI: roundedValue.toString() };
- return newItem;
- });
- setData(newData);
- }, 2000);
- return () => clearTimeout(timer);
- }, [data]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement