-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Model Account
and AccountService
as Spezi Module
#60
Conversation
23376d7
to
0605b23
Compare
0605b23
to
f45fcf4
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #60 +/- ##
==========================================
- Coverage 76.12% 73.12% -3.00%
==========================================
Files 116 115 -1
Lines 4020 4065 +45
==========================================
- Hits 3060 2972 -88
- Misses 960 1093 +133
... and 9 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Account
and AccountService
as Spezi Module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work; great to see how all these things are starting to interconnect; great job @Supereg!!
Model
Account
andAccountService
as Spezi Module♻️ Current situation & Problem
The
Account
model andAccountService
s were introduced before Spezi had sophisticated support for Modules. Therefore, SpeziAccount provides infrastructure like the@AccountReference
to access theAccount
model from certain places like an Account Service or from a Standard that conforms to a SpeziAccount constraint. Other than that, theAccount
model can only be accessed from within the SwiftUI view hierarchy.This design is generally relatively inflexible and one has to find workarounds to (a) access
Account
from a Spezi Module and (b) access Spezi Modules from within anAccountService
. Typically this involves nesting Account Services into basically empty Spezi Modules or injecting ViewModifiers into the global SwiftUI view hierarchy to get access to theAccount
.This PR addresses the problem by making
Account
andAccountServices
Spezi Modules that can be used with all Spezi infrastructure like the@Dependency
property wrapper. This greatly improves flexibility when developing with SpeziAccount.⚙️ Release Notes
@Dependency
property wrapper.AccountService
s are now Spezi Modules that can use Spezi infrastructure.📚 Documentation
TBA
✅ Testing
--
📝 Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: