0.2.1 • Published 2 years ago

mqfunctions v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

mqfunctions

Test Status License MIT npm version codecov

JavaScript library to manage matchMedia handlers.

Install

npm install mqfunctions

Use

import { createMqFunctions } from 'mqfunctions'

const mqf = createMqFunctions('(min-width: 768px)')

// Add matchMedia handler
mqf.add('function-01', (event) => {
  if (event.matches) {
    console.log('Resized window to PC size!')
  } else {
    console.log('Resized window to SP size!')
  }
})

// Run handler arbitrarily
mqf.run('function-01')

// Remove handler
mqf.remove('function-01')

License

MIT License.

0.2.1

2 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.1.0-alpha.4

3 years ago

0.1.0-alpha.3

3 years ago

0.1.0-alpha.2

3 years ago

0.1.0-alpha.1

3 years ago