mirror of
https://github.com/khairul169/code-share.git
synced 2025-04-29 00:59:37 +07:00
10 lines
241 B
TypeScript
10 lines
241 B
TypeScript
export const data = async () => {
|
|
const posts = await fetch(
|
|
"https://jsonplaceholder.typicode.com/posts?_limit=20"
|
|
).then((response) => response.json());
|
|
|
|
return { posts };
|
|
};
|
|
|
|
export type Data = Awaited<ReturnType<typeof data>>;
|