chore: adds commenting to obscure form function

This commit is contained in:
James
2022-08-12 13:11:49 -07:00
parent b8421ddc0c
commit 9e4e4b231c
2 changed files with 4 additions and 1 deletions

View File

@@ -1,5 +1,4 @@
import equal from 'deep-equal';
import ObjectID from 'bson-objectid';
import { unflatten, flatten } from 'flatley';
import flattenFilters from './flattenFilters';
import getSiblingData from './getSiblingData';

View File

@@ -367,6 +367,10 @@ const Form: React.FC<Props> = (props) => {
refreshCookie();
}, 15000, [fields]);
// Re-run form validation every second
// as fields change, because field validations can
// potentially rely on OTHER field values to determine
// if they are valid or not (siblingData, data)
useThrottledEffect(() => {
validateForm();
}, 1000, [validateForm, fields]);