MCPcopy Index your code
hub / github.com/streamich/react-use / triggerOrientation

Function triggerOrientation

tests/useOrientation.test.ts:35–40  ·  view source on GitHub ↗
(type: string, angle: number)

Source from the content-addressed store, hash-verified

33 }
34
35 function triggerOrientation(type: string, angle: number) {
36 (window.screen.orientation.type as string) = type;
37 (window.screen.orientation.angle as number) = angle;
38
39 window.dispatchEvent(new Event('orientationchange'));
40 }
41
42 it('should return current window orientation', () => {
43 const hook = getHook();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…