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: Use shared StartStopTypedEventHandler for Sensors #19166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nickodei
Copy link

@nickodei nickodei commented Jan 7, 2025

GitHub Issue: closes #19131

PR Type

What kind of change does this PR introduce?

  • Refactoring (no functional changes, no api changes)

What is the current behavior?

Most sensors used an TypedEventHandler field and had duplicated logic on the event handling.

What is the new behavior?

Refactoring to use StartStopTypedEventHandler that encapsulates the logic for event-handling.
This is now used in the sensor classes instead.

PR Checklist

Please check if your PR fulfills the following requirements:

@CLAassistant
Copy link

CLAassistant commented Jan 7, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform labels Jan 7, 2025
@nickodei
Copy link
Author

nickodei commented Jan 7, 2025

I also saw that on a lot of sensor classes, the GetDefault() Method was duplicated as well. In LightSensor we use Lazy<LightSensor?> _instance. Should this also be done for the other sensors? I wasn't sure about it.

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19166/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 151254 has failed on Uno.UI - CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use StartStopEventWrapper for sensor events
3 participants