美文网首页
async的三种写法

async的三种写法

作者: 简陌刀丶阿吉 | 来源:发表于2021-07-27 13:29 被阅读0次

async的三写法

        const parameter = async () => {
            return { number: getRandom(),  status: getRandom() };
        };

        const parameter = () => new Promise((resolve) => {
            resolve({
                 number: getRandom(),  status: getRandom()
            })
        });

        const authParamsSupplier = function() {
            return {
               number: getRandom(),  status: getRandom()
            }
        };

相关文章

网友评论

      本文标题:async的三种写法

      本文链接:https://www.haomeiwen.com/subject/axybultx.html