I think I do not understand, why am I getting Promise
in return? I need to create object. Both options to return a value from promise do not work.
Why i
async
and await
are tools to manage promises by letting you use syntax that appears to be non-asynchronous inside an async
function.
Consequently, an async
function will always return a promise (which will resolve to whatever the return value is when all the promises inside it have resolved).
You are wrong about the function after case 'Register':
. It returns a promise. You have no code to examine what it returns though.