13 lines
306 B
JavaScript
13 lines
306 B
JavaScript
|
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);
|
||
|
}
|