@thunderstorefront/sdk
Version:
Create Nuxt extendable layer with this GitHub template.
16 lines (11 loc) • 328 B
text/typescript
import type { Page } from '@thunderstorefront/types';
export interface UsePage {
fetchPage: (id: string) => Promise<Page>;
}
export function usePage(): UsePage {
const client = useClient();
async function fetchPage(id: string): Promise<Page> {
return await client(`/api/page/${id}`);
}
return { fetchPage };
}