WICG / color-api

A proposal and draft spec for a Color object for the Web Platform, loosely influenced by the Color.js work. Heavily WIP, if you landed here randomly, please move along.
https://wicg.github.io/color-api/
Other
130 stars 3 forks source link

Promises #8

Closed svgeesus closed 1 year ago

svgeesus commented 3 years ago

Should we do something cool if the coord is set to a promise? What happens until the promise resolves? What if it’s set to another value in the meantime?

Or should promises be disallowed?

svgeesus commented 2 years ago

What happens until the promise resolves?

LeaVerou commented 1 year ago

There is no reason to do that. Authors should take care of resolving promises before constructing Color objects, rather than the Color object constructor having to deal with Promises.

tabatkins commented 1 year ago

Agreed; APIs consuming promises only do so when the Promise-ness is itself a significant thing for the API to observe and respond to (using it as a timing signal, chaining from it, conglomerating several promises efficiently, etc). For everything else, await pval is the right way to pass a Promise'd value into a function.