2018-08-23 06:00:53 +02:00
|
|
|
import { registerResizeListener } from '../../_utils/resize'
|
|
|
|
|
|
|
|
export function resizeObservers (store) {
|
|
|
|
if (!process.browser) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
const recalculateIsMobileSize = () => {
|
2018-08-30 06:42:57 +02:00
|
|
|
store.set({ isMobileSize: window.matchMedia('(max-width: 767px)').matches })
|
2018-08-23 06:00:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
registerResizeListener(recalculateIsMobileSize)
|
|
|
|
recalculateIsMobileSize()
|
|
|
|
}
|