Appearance
useCountries ​
Definition ​
Composable to manage countries
Basic usage ​
ts
const {
getCountries,
mountedCallback,
fetchCountries,
getStatesForCountry
} = useCountries();
Signature ​
ts
export function useCountries(): UseCountriesReturn
Return type ​
See UseCountriesReturn
ts
export type UseCountriesReturn = {
mountedCallback(): Promise<void>;
getCountries: ComputedRef<Schemas["Country"][]>;
fetchCountries(): Promise<
operations["readCountry post /country"]["response"]
>;
getStatesForCountry(countryId: string): Schemas["CountryState"][] | null;
};
Properties ​
| Name | Type | Description |
|---|---|---|
| getCountries | ComputedRef<Array<>> |
Methods ​
| Name | Type | Description |
|---|---|---|
| mountedCallback | Promise<void> | |
| fetchCountries | Promise<> | |
| getStatesForCountry | Array<> | |