Skip to content
Source
Sign inSign up
Open History to see the last commit

browserDeviceToolbarState.ts

11 lines393 Bytes

1import type { PreviewViewportSetting } from "@t3tools/contracts";
2​
3export async function commitViewportAndAspectRatio(
4 setting: PreviewViewportSetting,
5 aspectRatio: number | null,
6 onChange: (setting: PreviewViewportSetting) => Promise<void>,
7 onAspectRatioChange: (aspectRatio: number | null) => void,
8): Promise<void> {
9 await onChange(setting);
10 onAspectRatioChange(aspectRatio);