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