File size: 432 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import type { CountriesState } from '../countries/types';
import type { IAppState } from '../types';

import 'calypso/state/countries/init';

/**
 * Retrieves the list of countries from the specified type.
 *
 * The country data types are 'domains, 'payments', or 'sms'.
 */
export default function getCountries< TType extends keyof CountriesState >(
	state: IAppState,
	type: TType
) {
	return state.countries?.[ type ] ?? null;
}