1.1.0 • Published 8 months ago

@ryze-digital/js-utilities v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

RYZE Digital JavaScript Utilities

Run linter(s) workflow status

Install

npm i @ryze-digital/js-utilities --save

Usage

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"
}