Download wp-calypso/client/components/data/query-jetpack-scan/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 675 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/data/query-jetpack-scan/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/data/query-jetpack-scan/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/data/query-jetpack-scan/index.tsx
675 Bytes
| import { useEffect } from 'react'; | |
| import { useDispatch, useSelector } from 'calypso/state'; | |
| import { requestScanStatus } from 'calypso/state/jetpack-scan/actions'; | |
| import isRequestingJetpackScan from 'calypso/state/selectors/is-requesting-jetpack-scan'; | |
| interface Props { | |
| siteId: number; | |
| } | |
| const QueryJetpackScan = ( { siteId }: Props ) => { | |
| const requestingJetpackScan = useSelector( ( state ) => | |
| isRequestingJetpackScan( state, siteId ) | |
| ); | |
| const dispatch = useDispatch(); | |
| useEffect( () => { | |
| if ( requestingJetpackScan ) { | |
| return; | |
| } | |
| siteId && dispatch( requestScanStatus( siteId ) ); | |
| }, [ siteId ] ); | |
| return null; | |
| }; | |
| export default QueryJetpackScan; | |