ScreenMixin

ScreenMixin

Source:

class used to handle window resize events

Example

import ScreenMixin, { mix } from '@/core/ScreenMixin'
import {
	ScreenMixin,
} from '@/core/modules/'

export default class ExampleWithAllTheThings extends mix(Behaviour).with(
	ScreenMixin
) {
	mount = () => {
		this.$$screen.on('window:resize', () => {})
	}

	screens = {
		'(min-width: 1024px)': ({ match, ...rest }) => {
			if (match) {
				log(rest)
			}
		}
	}
}