Download wp-calypso/packages/data-stores/src/wpcom-plans-ui/selectors.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 925 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/wpcom-plans-ui/selectors.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/data-stores/src/wpcom-plans-ui/selectors.ts
-
curl -L -o selectors.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/wpcom-plans-ui/selectors.ts
925 Bytes
| import { PlanSlug } from '@automattic/calypso-products'; | |
| import type { State } from './reducer'; | |
| export const isDomainUpsellDialogShown = ( state: State ) => !! state.showDomainUpsellDialog; | |
| export const getSelectedStorageOptionForPlan = ( | |
| state: State, | |
| planSlug: PlanSlug, | |
| siteId?: number | null | |
| ) => { | |
| // @ts-expect-error TS is unhappy if we index an object by a null or an undefined value. We, however, | |
| // expect siteId to be null or undefined here before site creation ( Ex. during onboarding ). | |
| return state.selectedStorageOptionForPlan?.[ siteId ]?.[ planSlug ]; | |
| }; | |
| export const getSelectedStorageOptions = ( state: State, siteId?: number | null ) => { | |
| // @ts-expect-error TS is unhappy if we index an object by a null or an undefined value. We, however, | |
| // expect siteId to be null or undefined here before site creation ( Ex. during onboarding ). | |
| return state.selectedStorageOptionForPlan?.[ siteId ]; | |
| }; | |