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

Replace try_get() with get() in several trait implementations for signals #3569

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mahdi739
Copy link
Contributor

@mahdi739 mahdi739 commented Feb 9, 2025

This PR replaces the use of get() with try_get() for retrieving signal values in these trait implementations:

  • IntoProperty
  • IntoClass
  • IntoStyle
  • Render
  • RenderHtml
  • AttributeValue
  • InnerHtmlValue
    This change prevents potential panics when the signal is disposed.
    As a result, I've replaced most if let blocks in RenderEffects with match statements to handle different variations of the previous state and the signal value better.
    There are some match arms that don't make much sense to me, which usually happens when a signal is disposed, so I just returned None or the previous state if it was possible.

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.

1 participant