Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(graph): Inline debounce logic in GraphProvider #65

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

toyamarinyon
Copy link
Contributor

Simplify state management by removing separate useDebounce hook and incorporating debouncing directly in the GraphProvider component. The functionality remains the same but with cleaner code organization.

Key changes:

  • Remove standalone useDebounce hook
  • Add timeout handling directly in enhancedDispatch
  • Clean up timeout on component unmount
  • Fix potential memory leak by clearing timeout between state updates

The 500ms debounce delay for graph updates is preserved.

Verification Steps

The following operations should work without regression:

  • Display Playground.
  • Move the node
  • Wait 1 second
  • Reload
  • The node is displayed at the position where you moved it.

Simplify state management by removing separate useDebounce hook and
incorporating debouncing directly in the GraphProvider component.
The functionality remains the same but with cleaner code organization.

Key changes:
- Remove standalone useDebounce hook
- Add timeout handling directly in enhancedDispatch
- Clean up timeout on component unmount
- Fix potential memory leak by clearing timeout between state updates

The 500ms debounce delay for graph updates is preserved.
@toyamarinyon toyamarinyon requested a review from shige as a code owner October 30, 2024 09:32
Copy link

vercel bot commented Oct 30, 2024

@toyamarinyon is attempting to deploy a commit to the Edge Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giselle ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 9:37am

Copy link
Member

@shige shige left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@toyamarinyon toyamarinyon merged commit 9813f8e into giselles-ai:main Oct 30, 2024
5 checks passed
@toyamarinyon toyamarinyon deleted the improve-debounce branch October 30, 2024 11:57
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