content icon indicating copy to clipboard operation
content copied to clipboard

Promise can't resolve multiple times

Open ottoville opened this issue 9 months ago • 2 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder/decode

What specific section or headline is this issue about?

completeframesonly

What information was incorrect, unhelpful, or incomplete?

The phrase:

“the promise returned by decode() will resolve exactly once for each new level of detail”

reads like one promise resolves multiple times.

But that would violate JavaScript semantics:

  • A Promise settles once.
  • After resolution, it cannot resolve again.
  • It cannot “emit” multiple values.

What did you expect to see?

Each call to decode() returns a promise that resolves once, and if additional detail becomes available later, calling decode() again will return another promise that resolves when the next level is ready.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
  • Folder: en-us/web/api/imagedecoder/decode
  • MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder/decode
  • GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/imagedecoder/decode/index.md
  • Last commit: https://github.com/mdn/content/commit/a7482281c4570bb7f932dce381f510d87ddf9924
  • Document last modified: 2024-10-31T03:19:16.000Z

ottoville avatar Feb 28 '26 19:02 ottoville

Hi, @Josh-Cena I'd love to take this issue, if needed. are you able to assign it to me? Best regards

dataCenter430 avatar Mar 02 '26 22:03 dataCenter430

We don't assign. Just make the PR.

Josh-Cena avatar Mar 03 '26 01:03 Josh-Cena