-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why are we using Promises here? #6
Comments
Thanks for the feedback! I've hopefully addressed the issues you've raised and have opened #8 to discuss the iframe behaviour in more detail. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not certain why Promises are involved here. I understand that these are writing to what is likely an async storage, but that doesn't necessarily have to mean that the author-facing API is async, especially if it's solely used to track the overrides themselves.
That is, setting
navigator.preference.colorScheme = "dark";
can be done synchronously; thepreference
object immediately reflects the "dark" value. But it will affect the actual MQ asynchronously, and authors can listen for that change with an appropriate async API.This has several benefits:
If we want to allow authors to see the "real" value of the MQ, we could add an async method to this API. We could probably just bake it into the getSupported() method, adding a
currentValue
attribute, since that method is already async.The text was updated successfully, but these errors were encountered: