diff --git a/src/client/Elements/Input.jsx b/src/client/Elements/Input.jsx index b8e8095..1f03316 100644 --- a/src/client/Elements/Input.jsx +++ b/src/client/Elements/Input.jsx @@ -3,11 +3,12 @@ import { useStores } from 'client/hooks/useStores'; import { observer } from 'mobx-react'; import React, { useEffect, useState } from 'react'; import { useDebounce } from 'use-debounce'; +import { DEBOUNCE_DELAY } from '../../constants/debounce'; const Input = ({ readonly, placeholder, bindedValueName, computedValue }) => { const { calculationStore } = useStores(); const [currentValue, setCurrentValue] = useState(undefined); - const [debouncedValue] = useDebounce(currentValue, 850); + const [debouncedValue] = useDebounce(currentValue, DEBOUNCE_DELAY); const sourceValue = calculationStore.values[bindedValueName]; diff --git a/src/constants/debounce.js b/src/constants/debounce.js new file mode 100644 index 0000000..3bc0649 --- /dev/null +++ b/src/constants/debounce.js @@ -0,0 +1 @@ +export const DEBOUNCE_DELAY = 800;