webui/src/lib/screen.ts

10 lines
271 B
TypeScript
Raw Normal View History

import { writable } from 'svelte/store';
// Create a writable store to track screen size
export const screenSize = writable<number>(window.innerWidth);
// Function to update the screen size
export const updateScreenSize = () => {
screenSize.set(window.innerWidth);
};