Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@dreamworld/device-info
Advanced tools
It's used to get basic details of device(layout, touch and virtual keyboard).
It's used to get detail about Device like:
Many UI components need to adjust their look & feel and/or behaviours based on this detail. They can use this to get this information; and get updated when any of this information is changed.
All of the @dreamworld/* Web Components uses (are going to use) this.
import DeviceInfo from "@dreamworld/device-info";
//Get info
let deviceInfo = DeviceInfo.info(); // { layout: "small", touch: true, vkb: false }
import DeviceInfo from "@dreamworld/device-info";
//Bind event
DeviceInfo.on("change", (details) => {
//details contains only properties which are really changed.
});
//Unbind event
DeviceInfo.off("change", handler);
import { LitElement, html } from "lit";
import DeviceInfo from "@dreamworld/device-info";
class MyComponent extends LitElement {
deviceInfo = new DeviceInfo(this);
// Use the controller in render()
render() {
return html`
current layout: ${this.deviceInfo.layout} is touch enabled: ${this
.deviceInfo.touch} is Virtual keyboard supported: ${this.deviceInfo.vkb}
`;
}
}
import { default as DeviceInfo, selectors } from "@dreamworld/device-info";
//Init redux
DeviceInfo.initRedux(store);
//use selectors to read details from redux store
let layout = selectors.layout(state);
let isTouchEnabled = selectors.touch(state);
let isVKBEnabled = selectors.vkb(state);
It manages state at below path.
Path: device-info
name | data type | description |
---|---|---|
layout | String | Possible values: small , medium , large , hd and fullhd . |
touch | Boolean | true if device touch is enabled. false otherwise. |
vkb | Boolean | true if device virtual keyboard is supported. false otherwise. |
FAQs
It's used to get basic details of device(layout, touch and virtual keyboard).
The npm package @dreamworld/device-info receives a total of 37 weekly downloads. As such, @dreamworld/device-info popularity was classified as not popular.
We found that @dreamworld/device-info demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.