(shouldUpdateValid?: boolean)
| 194 | }; |
| 195 | |
| 196 | const _setValid = async (shouldUpdateValid?: boolean) => { |
| 197 | if (_state.keepIsValid) { |
| 198 | return; |
| 199 | } |
| 200 | if ( |
| 201 | !_options.disabled && |
| 202 | (_proxyFormState.isValid || |
| 203 | _proxySubscribeFormState.isValid || |
| 204 | shouldUpdateValid) |
| 205 | ) { |
| 206 | let isValid: boolean; |
| 207 | if (_options.resolver) { |
| 208 | isValid = isEmptyObject((await _runSchema()).errors); |
| 209 | _updateIsValidating(); |
| 210 | } else { |
| 211 | isValid = await executeBuiltInValidation({ |
| 212 | fields: _fields, |
| 213 | onlyCheckValid: true, |
| 214 | eventType: EVENTS.VALID, |
| 215 | }); |
| 216 | } |
| 217 | if (isValid !== _formState.isValid) { |
| 218 | _subjects.state.next({ |
| 219 | isValid, |
| 220 | }); |
| 221 | } |
| 222 | } |
| 223 | }; |
| 224 | |
| 225 | const _updateIsValidating = (names?: string[], isValidating?: boolean) => { |
| 226 | if ( |
no test coverage detected