0.2.1 • Published 8 months ago

mqfunctions v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months 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

8 months ago

0.2.0

2 years ago

0.1.0

2 years ago

0.1.0-alpha.4

2 years ago

0.1.0-alpha.3

2 years ago

0.1.0-alpha.2

2 years ago

0.1.0-alpha.1

2 years ago