partial
This commit is contained in:
parent
b135fe20d0
commit
e99dd024d5
@ -13,9 +13,9 @@ const Input = ({
|
||||
Effects,
|
||||
}) => {
|
||||
const { calculationStore } = useStores();
|
||||
const sourceValue = calculationStore.getValue(sourceValueName);
|
||||
const [currentValue, setCurrentValue] = useState(undefined);
|
||||
const [debouncedValue] = useDebounce(currentValue, 850);
|
||||
const sourceValue = calculationStore.getValue(sourceValueName);
|
||||
|
||||
// get Values
|
||||
useEffect(() => {
|
||||
@ -24,11 +24,7 @@ const Input = ({
|
||||
setCurrentValue(sourceValue);
|
||||
}
|
||||
}
|
||||
if (getValue) {
|
||||
const value = getValue(calculationStore);
|
||||
setCurrentValue(value);
|
||||
}
|
||||
}, [sourceValue]);
|
||||
}, [sourceValue, sourceValueName]);
|
||||
|
||||
// run Effects
|
||||
useEffect(() => {
|
||||
@ -39,8 +35,7 @@ const Input = ({
|
||||
if (sourceValueName && debouncedValue) {
|
||||
calculationStore.setValue(sourceValueName, debouncedValue);
|
||||
}
|
||||
console.log(calculationStore.values);
|
||||
}, [debouncedValue]);
|
||||
}, [debouncedValue, sourceValueName]);
|
||||
|
||||
return (
|
||||
<AntInput
|
||||
|
||||
Reference in New Issue
Block a user