-
Notifications
You must be signed in to change notification settings - Fork 4
Description
I have an arrangement which makes services available via expose().
To access this service from the arrangement within my fragments, I have to implement this function in expose() again.

I struggled with getting this communication to work in the beginning, as it was unclear to me why and how I have to (re-)implement functions within a fragment to call them from the "external" arrangement.
I have two recommendations for clarifying this design choice and making it more beginner friendly:
No. 1: Clearly stating the options and reasons to choose them could make it easier to understand conceptually
The re-implementation of external functionalities within the fragments expose() was decided upon to create a clear fallback strategy, when the external service is not available.
This re-implementation can
- be empty, if the fragment does not have to be usable outside the context enabling the external functionality
- resemble the full external functionality, to make the fragment independent and fully featured without any context
- contain any other fallback functionality to be called of external service not available
No. 2: I think it would be very helpful for situations like this to get meaningful errors from collage as to why I can't access a function.
Errors like the following could lower the barrier to entry:
- "Uncaught (in promise) collageError: api.services.ArrangementName.getHelloWorld is not a defined in the Collage API expose() initialization, see here: LINK TO DOKU"
Thanks :)
