
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
reactive-media-queries
Advanced tools
Simple and declarative media queries triggers. Written in Typescript. Define breakpoints and get notified when it changes.
Simple and declarative media queries triggers. Written in Typescript. Define breakpoints and get notified when it changes.
npm install reactive-media-queries
#or
yarn add reactive-media-queries
This library exports a single function with the following signature:
reactToBreakpoints(breakpoints, callback) => teardownFunction
It returns a teardown function that you can use to remove all the DOM listeners.
import reactToBreakpoints from 'reactive-media-queries'
const teardownListeners = reactToBreakpoints({
phone: 768,
tablet: 1024,
desktop: 1440,
desktopXL: Infinity,
}, (key) => {
// whenever a matched breakpoint changes this callback is triggered and the key argument is the current breakpoint id
// eg: key == phone | tablet | desktop | desktopXL
console.log('Current breakpoint is: ' + key);
})
// if you need to unsubscribe to media queries and detach event listeners just call the function return by reactToBreakpoints()
teardownListeners()
Just teardown previous listeners and run reactToBreakpoints(newBreakpoints, callback)
import ReactiveMediaQueries from 'reactive-media-queries';
import { ref } from '@vue/composition-api';
const currentBreakpoint = ref(null);
reactToBreakpoints({
phone: 768,
tablet: 1024,
desktop: 1440,
desktopXL: Infinity,
}, (key) => {
currentBreakpoint.value = key;
})();
export default function useMQ () {
return { currentBreakpoint };
}
FAQs
Simple and declarative media queries triggers. Written in Typescript. Define breakpoints and get notified when it changes.
We found that reactive-media-queries demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.