Skip to content

Conversation

@astandrik
Copy link
Contributor

@astandrik astandrik commented Nov 15, 2025

Closes #183

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

Copilot finished reviewing on behalf of astandrik November 15, 2025 09:31
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 adds two convenience helper methods to GraphComponent for subscribing to events with automatic cleanup on component unmount.

  • Adds onGraphEvent method for subscribing to graph events
  • Adds onRootEvent method for subscribing to DOM events on the root element
  • Includes comprehensive test coverage for both new methods and cleanup behavior

Reviewed Changes

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

File Description
src/components/canvas/GraphComponent/index.tsx Adds two protected helper methods (onGraphEvent and onRootEvent) that wrap event subscriptions and register cleanup handlers
src/components/canvas/GraphComponent/GraphComponent.test.ts Adds comprehensive tests verifying event subscription and automatic cleanup on unmount for both helper methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@draedful draedful self-assigned this Nov 16, 2025
@astandrik astandrik merged commit 25fd4c8 into main Nov 20, 2025
5 checks passed
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.

Add helpers to subsribe events for GraphComponent

4 participants