How to document resolved values of JavaScript promises

后端 未结 2 580
栀梦
栀梦 2021-01-02 03:35

Given this code :

function asyncFoo() {
  return new Promise(function (fulfill, reject) {
    doAsyncStuff(function(err, data) {
      if(err) reject(new Er         


        
2条回答
  •  难免孤独
    2021-01-02 04:09

    Looks like you should do the following, based on some other source code's comments.

    /**
     * @return {Promise.}
     */
    

    How JavaScript Promises are documented.

    Similar question with a similar answer. Note the lack of a dot in that answer.

提交回复
热议问题