Currently all features tests must be async. It would be nice if has supported the ability to add a feature test that sets the result based on the resolution of a Thenable.
There are considerations of if a feature is being defined async, and that the feature is requested sync before the detection is resolved, could cause some false issues. has() could be modified to not error if a unresolved Thenable feature is being detected and exists() could return false.
The ability to return Promises and the like from the API would likely only complicate things and "bloat" the dependencies of has though, just handling Thenables would require no additional dependencies, as it would simply detect the Thenable and chain on the setting of the result.
Currently all features tests must be async. It would be nice if
has
supported the ability to add a feature test that sets the result based on the resolution of a Thenable.There are considerations of if a feature is being defined async, and that the feature is requested sync before the detection is resolved, could cause some false issues.
has()
could be modified to not error if a unresolved Thenable feature is being detected andexists()
could returnfalse
.The ability to return Promises and the like from the API would likely only complicate things and "bloat" the dependencies of
has
though, just handling Thenables would require no additional dependencies, as it would simply detect the Thenable and chain on the setting of the result.