Skip to content

TysEvent

Type@tryyoursize/react-native

A window event, by type.

type TysEvent =
| { type: "ready"; product: string }
| { type: "open"; product: string }
| { type: "close"; product: string }
| { type: "size"; selection: SizeSelection }
| { type: "loaderror"; code: string; message: string };
const sub = addEventListener((e) => {
if (e.type === "size") setSize(e.selection.size);
if (e.type === "loaderror") console.warn(e.code);
});

Was this page helpful?