Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71329

Promise chains aren't fully implemented

    XMLWordPrintable

    Details

    • Platform/s:
      All
    • Commits:
      f3d40896c1d8601703fcbf30214e22f50eb72727 (qt/qtdeclarative/5.12)

      Description

      Returning a Promise inside a then callback does not resolve that promise. It just passes that promise to the next then callback.

      Code:

      new Promise((res) => {
          res(1)
      })
      .then((data) => {
          console.log(data)
          return new Promise((res) => {res(2)});
      })
      .then((data) => {
          console.log(data)
          return new Promise((res) => {res(3)});
      })
      .then((data) => {
          console.log(data)
      });
      

       

      Expected output:

      qml: 1
      qml: 2
      qml: 3

      Actual output:

      qml: 1
      qml: [object Promise]
      qml: [object Promise]
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              fabiankosmale Fabian Kosmale
              Reporter:
              golgobot golgobot
            • Votes:
              20 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes