getViewportSize
A function that returns the current Viewport Size.
In a server environment, it returns { width: 0, height: 0 }.
Code
Interface
typescript
const getViewportSize: () => {
readonly width: number;
readonly height: number;
}
Usage
typescript
import { getViewportSize } from '@modern-kit/utils';
const { width, height } = getViewportSize();