1.1.0 • Published 8 months ago
@ryze-digital/js-utilities v1.1.0
RYZE Digital JavaScript Utilities
Install
npm i @ryze-digital/js-utilities --saveUsage
import * as utils from '@ryze-digital/js-utilities';Example
this.breakpointProvider = new utils.BreakpointProvider();
window.matchMedia(`(min-width: ${this.breakpointProvider.breakpoints.large})`).addListener(() => {
// Code gets executed when the viewport is at least "large"
});
if (window.matchMedia(`(max-width: ${this.breakpointProvider.breakpoints.medium})`).matches) {
// Condition evaluates to true, if the viewport is at most "medium"
}