Skip to content

Instantly share code, notes, and snippets.

View amadeuszblanik's full-sized avatar
👨‍💻
Working remotely

Amadeus Blanik amadeuszblanik

👨‍💻
Working remotely
View GitHub Profile
@amadeuszblanik
amadeuszblanik / mobileDetect.js
Last active June 5, 2019 13:24
Simple function to detect mobile `window.mobile`
export default class MobileDetect {
constructor() {
this.mount();
}
mount() {
if (typeof window === "object") {
if (window.mobile !== "undefined") {
window.mobile = function () {
let check = false;