Skip to content

Conversation

@bnidev
Copy link
Owner

@bnidev bnidev commented Aug 8, 2025

This PR introduces two new utilities to the DOM package:

  • onOrientationChange: A listener utility for device orientation changes using the Screen Orientation API.
  • onResize: A flexible resize listener that supports window, document, and specific HTML elements with debouncing and ResizeObserver.

@bnidev bnidev requested a review from Copilot August 8, 2025 09:23

This comment was marked as outdated.

@bnidev bnidev requested a review from Copilot August 8, 2025 09:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces two new DOM utilities for handling device interactions and responsive design:

  • onOrientationChange: A utility for listening to device orientation changes using the Screen Orientation API
  • onResize: A flexible resize listener supporting window, document, and HTML elements with debouncing and ResizeObserver

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/dom/onResize.ts Implements resize listener utility with debouncing for window/document and ResizeObserver for elements
src/dom/onOrientationChange.ts Implements orientation change listener using Screen Orientation API
src/dom/index.ts Exports the new utilities
src/dom/tests/onResize.test.ts Comprehensive test suite for resize utilities with mocked ResizeObserver
src/dom/tests/onOrientationChange.test.ts Test suite for orientation change utility
.changeset/petite-lamps-look.md Changeset for onResize feature
.changeset/common-crabs-fail.md Changeset for onOrientationChange feature

@bnidev bnidev merged commit 929622d into main Aug 8, 2025
9 checks passed
@bnidev bnidev deleted the feat/dom-orientation-resize branch August 8, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants