[Office Hours] How to properly access Spezi Modules #140
Unanswered
kkellybonilla
asked this question in
Office Hours
Replies: 1 comment 2 replies
-
Could you perhaps try creating the patientmanager as just a regular variable and then passing in the patientmanager in the init function of ActivityManager when calling it from the view? So set it as this:
And then in init:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Related Discussion
Hi! I'm working on the Stanford360 app, and I'm currently trying to connect the
PatientManager
module to all model managers in the app (activity, hydration, protein) such that our newDashboardView
properly reflects the app state as its updated in its respective views (e.g. logging water intake updates both the hydration and dashboard view).I was able to do this pretty easily for the hydration view since I just had to access the
PatientManager
from the environment; however, for the activity view, I need to access thePatientManager
within theActivityManager,
which is not a view. Thus, I would need to use the@Dependency
modifier; however, I get the following error when doing so:I believe this is because
ActivityManager
is not currently a Spezi Module. Is there another way to access thePatientManager
within theActivityManger
, or would the best approach be to make ourActivityManager
(and all managers for that matter) Spezi Modules?Reproduction
Stanford360/Activity/Model/ActivityModels/ActivityManager
Additional context
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions