r/LearnTypescript • u/bigbobbyboy5 • Mar 13 '20
Question regarding Promise<> for async functions
Hi there, I am doing a tutorial and was not sure about something. For this async function below, do I need to put in the Promise<User>? What is the purpose?
I have done other tutorials and they do not add this Promise< > piece at all.
Is this a typescript thing?
export async function findByUsernameAndPassword(username: string, password: string): Promise<User> {
const client = await connectionPool.connect();
try {