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