UNPKG

detect-touch-events

Version:

Detect if the browser supports the touch events api

16 lines (14 loc) 391 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var detectTouchEvents = { update: function update() { if (typeof window !== 'undefined') { detectTouchEvents.hasSupport = 'ontouchstart' in window; detectTouchEvents.browserSupportsApi = Boolean(window.TouchEvent); } } }; detectTouchEvents.update(); exports.default = detectTouchEvents;