Download wp-calypso/client/components/data/query-all-domains/index.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 545 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/data/query-all-domains/index.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/data/query-all-domains/index.jsx
-
curl -L -o index.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/data/query-all-domains/index.jsx
545 Bytes
| import { useEffect } from 'react'; | |
| import { useDispatch } from 'react-redux'; | |
| import { getAllDomainsRequest } from 'calypso/state/all-domains/actions'; | |
| import isRequestingAllDomains from 'calypso/state/selectors/is-requesting-all-domains'; | |
| const request = () => ( dispatch, getState ) => { | |
| if ( ! isRequestingAllDomains( getState() ) ) { | |
| dispatch( getAllDomainsRequest() ); | |
| } | |
| }; | |
| export default function QueryAllDomains() { | |
| const dispatch = useDispatch(); | |
| useEffect( () => { | |
| dispatch( request() ); | |
| }, [ dispatch ] ); | |
| return null; | |
| } | |