Skip to content
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

Send events before promise resolve #120

Closed
kenchris opened this issue Sep 21, 2018 · 1 comment
Closed

Send events before promise resolve #120

kenchris opened this issue Sep 21, 2018 · 1 comment
Assignees

Comments

@kenchris
Copy link

An annoyance with the orientation lock API, is that the promise resolves before the event is sent.

This makes it hard to default handlers that you don't want to call in certain cases, because if you remove the handler then there is no good place to add it back in, because if you do after the promise gets resolves, it might get called as the event is still pending :-(

This also means that it makes sense for the unlock to return a promise.

We ran into this in intel/generic-sensor-demos#72

@marcoscaceres
Copy link
Member

I think this makes sense. Essentially, we need to queue a task to first dispatch, then resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants