Why am I getting Promise instead of a value?

后端 未结 1 1540
太阳男子
太阳男子 2020-12-04 02:27

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

相关标签:
1条回答
  • 2020-12-04 03:05

    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.

    0 讨论(0)
提交回复
热议问题