Download wp-calypso/packages/domains-table/src/use-domains-table.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 506 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/domains-table/src/use-domains-table.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/domains-table/src/use-domains-table.ts
-
curl -L -o use-domains-table.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/domains-table/src/use-domains-table.ts
506 Bytes
| import { | |
| type AllDomainsQueryFnData, | |
| useAllDomainsQuery, | |
| type AllDomainsQueryArgs, | |
| } from '@automattic/data-stores'; | |
| export function useDomainsTable( | |
| fetchAllDomains?: ( queryArgs?: AllDomainsQueryArgs ) => Promise< AllDomainsQueryFnData > | |
| ) { | |
| const queryArgs = { no_wpcom: true, resolve_status: true }; | |
| const { data, ...queryResult } = useAllDomainsQuery( | |
| queryArgs, | |
| fetchAllDomains && { queryFn: () => fetchAllDomains( queryArgs ) } | |
| ); | |
| return { ...queryResult, domains: data?.domains }; | |
| } | |