waffle/frontend/src/responsive.js

13 lines
306 B
JavaScript
Raw Normal View History

import { showSidebar } from "./stores";
export function initResponsiveHandlers() {
const mediaQuery = window.matchMedia('(min-width: 768px)');
const update = ({ matches }) => {
showSidebar.set(matches);
};
mediaQuery.addEventListener("change", update);
update(mediaQuery);
}