Download react-hook-form/src/logic/getValidationModes.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 410 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/logic/getValidationModes.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/logic/getValidationModes.ts
-
curl -L -o getValidationModes.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/src/logic/getValidationModes.ts
410 Bytes
| import { VALIDATION_MODE } from '../constants'; | |
| import type { Mode, ValidationModeFlags } from '../types'; | |
| export default (mode?: Mode): ValidationModeFlags => ({ | |
| isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit, | |
| isOnBlur: mode === VALIDATION_MODE.onBlur, | |
| isOnChange: mode === VALIDATION_MODE.onChange, | |
| isOnAll: mode === VALIDATION_MODE.all, | |
| isOnTouch: mode === VALIDATION_MODE.onTouched, | |
| }); | |