add debounce delay constant

This commit is contained in:
Chika 2020-09-01 21:24:28 +03:00
parent 65a06b4b4c
commit f45dc1edf7
2 changed files with 3 additions and 1 deletions

View File

@ -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];

View File

@ -0,0 +1 @@
export const DEBOUNCE_DELAY = 800;