ЙажаСценарий / Говнокод #28888 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
    const price = Number(event.target.value);
    setPrice(price);

    if (timer) {
      clearTimeout(timer);
      setTimer(null);
    }

    const validPrice = validatePrice(price);
    if (event.target.id.includes("cause")) {
      handleOnChange(validPrice);
    } else {
      const timerId: any = setTimeout(() => {
        setPrice(validPrice);
        handleOnChange(validPrice);
      }, 1000);

      setTimer(timerId);
    }
  };

:hang:

Запостил: Shannarra_ Shannarra_, (Updated )

Комментарии (1) RSS

Добавить комментарий

Из-за тебя ушел bormand, guest!

    А не использовать ли нам bbcode?


    8