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
feat(useScreenOrientation): new function #1526
Conversation
return new value `angle` `lockOrientation` return a promise Only execute part of the logic when `isSupported = true`
We could return |
@okxiaoliang4 Thank you for the suggestions, just updated the documentation for all correct orientation types. It will need your review again! Thanks :) |
I think the Promise.reject makes sense actually, it looks like |
@okxiaoliang4 Also, could you set me to the assignee please as I was the one that opened the PR... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can link to the type definition lib.dom.d.ts
doesn't seem like a good idea. |
sure, I only want follow this pr |
Awesome 🙏 thank you. Just so I have the blame on this one if there are issues, so new Issues can be assigned to me. :) |
Description
This is a reactive composable that can relay the
OrientationLockType
, e.g., "primary-portrait" etc reactively, listening to theorientationchange
event.It is modelled around the Screen Orientation API MDN.
I'm not 100% convinced we need locking and unlocking, as this is almost a unused feature for most workflows, so please let me know if this is required.
Please view useScreenOrientation Loom Video Demonstration for demonstration.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).