add debounce delay constant
This commit is contained in:
parent
65a06b4b4c
commit
f45dc1edf7
@ -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];
|
||||
|
||||
|
||||
1
src/constants/debounce.js
Normal file
1
src/constants/debounce.js
Normal file
@ -0,0 +1 @@
|
||||
export const DEBOUNCE_DELAY = 800;
|
||||
Reference in New Issue
Block a user