Skip to content

progress-labs/matchMaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQ Match Maker

A really small library to make working with matchMedia a little easier.

Installation

Using npm:

npm i --save mq-match-maker

Usage

const foo = (matches) => {
    console.log(matches ? 'foo' : 'bar' )
}

matchMaker.register('(min-width: 600px)', foo)

matchMaker.deregister('(min-width: 600px)', foo)

Prevent callback from firing on initial load

const foo = (matches) => {
    console.log(matches ? 'foo' : 'bar' )
}

matchMaker.register('(min-width: 600px)', foo, false)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published