Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const mediaQueries = {
- mobile: '(max-width: 425px)',
- laptop: '(max-width: 1024px)',
- desktop: '(min-width: 1025px)',
- };
- const DEVICES = keys(mediaQueries);
- const matches = (device) => window.matchMedia(mediaQueries[device]).matches;
- const currentDevice = () => find(matches, DEVICES) || 'desktop';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement