Apologies about the elementary question. I am wondering about this specific bracket notation I found in a function in Typescript:
const results = await getAllUsers();
const totalUsers = await getUserCount();
const firstUser = await getFirstUser();
return {
props: {
meta: defaultMetaProps,
results,
totalUsers,
user: firstUser
},
revalidate: 10
};
From what I can tell online, the main way to use brackets in Typescript is to specify properties of objects, like:
props = {
a: 'a',
b: 'b'
}
However, I am confused because this set of lines does not seem to follow that convention:
props: {
meta: defaultMetaProps,
results,
totalUsers,
user: firstUser
}
Specifically, results
and totalUsers
don't have corresponding property names. Am I misinterpreting something?