![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
lesca-sensor-orientation
Advanced tools
The mobile device orientation. include request permission and return 3 axis value.
full steps for get mobile 3 axis value of mobile orientation.
See https://developer.mozilla.org/en-US/docs/Web/Events/Detecting_device_orientation for a demonstration!
npm install lesca-sensor-orientation --save
As a Node module:
import { useState, useEffect, useMemo } from 'react';
import Orientation from 'lesca-sensor-orientation';
// (1) waiting for permission => Must be user-triggered event and SSL required
// (2) add addEventListener
const Components = () => {
const [state, setState] = useState(false);
const orientation = useMemo(() => new Orientation(), []);
const require_permission = () => {
orientation
.permission()
.then(() => {
// permission granted
setState(true);
})
.catch(() => {
// permission deined
});
};
useEffect(() => {
if (state) {
orientation.addEventListener((e) => {
alert(e);
});
}
return () => {
orientation.destory();
};
}, [state]);
return <button onClick={require_permission}></button>;
};
method | description | return |
---|---|---|
.permission() | ask user permission | void |
addEventListener(callback:function) | get 3 axis value each time | void |
.destory() | destory event | void |
Properties | description | default |
---|---|---|
disable:boolean | stop / continue event listen | true |
isSuppord:boolean | permission granted or deined | (read only) |
FAQs
The mobile device orientation. include request permission and return 3 axis value.
We found that lesca-sensor-orientation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.