Represent maps
// rather than
const map: {[ key: string ]: string} = {
foo: 'bar',
}
// /pages/index.tsx | |
function ExamplePage() { | |
const { data } = useBackend( | |
"get-user-info", | |
async () => { | |
const data = await getProfileFromDB(); | |
return data; // {name: string} | |
}, | |
{ prefetch: true } |