Download react-hook-form/src/logic/shouldSubscribeByName.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 476 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/logic/shouldSubscribeByName.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/src/logic/shouldSubscribeByName.ts
-
curl -L -o shouldSubscribeByName.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/logic/shouldSubscribeByName.ts
476 Bytes
| import convertToArrayPayload from '../utils/convertToArrayPayload'; | |
| export default <T extends string | readonly string[] | undefined>( | |
| name?: T, | |
| signalName?: string, | |
| exact?: boolean, | |
| ) => | |
| !name || | |
| !signalName || | |
| name === signalName || | |
| convertToArrayPayload(name).some( | |
| (currentName) => | |
| currentName && | |
| (exact | |
| ? currentName === signalName | |
| : currentName.startsWith(signalName) || | |
| signalName.startsWith(currentName)), | |
| ); | |