Skip to content

Promise can't resolve multiple times #43297

@ottoville

Description

@ottoville

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:WebAPIWeb API docsaccepting PRFeel free to open a PR to resolve this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions