Download wp-calypso/client/state/ui/selectors/get-selected-site.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/ui/selectors/get-selected-site.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/ui/selectors/get-selected-site.ts
-
curl -L -o get-selected-site.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/ui/selectors/get-selected-site.ts
504 Bytes
| import getSite from 'calypso/state/sites/selectors/get-site'; | |
| import getSelectedSiteId from './get-selected-site-id'; | |
| import type { SiteDetails } from '@automattic/data-stores'; | |
| import type { AppState } from 'calypso/types'; | |
| /** | |
| * Returns the site object for the currently selected site. | |
| */ | |
| export default function getSelectedSite( state: AppState ): SiteDetails | null | undefined { | |
| const siteId = getSelectedSiteId( state ); | |
| if ( ! siteId ) { | |
| return null; | |
| } | |
| return getSite( state, siteId ); | |
| } | |