You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem appears when we are using multiple Components with the same contract definition (static), during the execution we are subscribe to multiple components and we are interesseted of uses same services contract from mutiple Component with different name.
For events, actually we are receiving all events but without the way to know the name of the emitter. A solution is to add the name of the emitter directly in the arguments of the events but this is not compatible with Component principles (do not modify used contract). For services, a solution is to create a services method manually which invoke the services from the targeted Component name, but this is uggly.
May be some solutions :
Services : Return a proxy when a service is called self myUsedComponentServices componentNamed: #componentB myServices
Events : get the name of the provider from the stack, as an example using thisContext to get the name of the emitter
This discussion was converted from issue #80 on January 13, 2024 15:51.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The problem appears when we are using multiple Components with the same contract definition (static), during the execution we are subscribe to multiple components and we are interesseted of uses same services contract from mutiple Component with different name.
For events, actually we are receiving all events but without the way to know the name of the emitter. A solution is to add the name of the emitter directly in the arguments of the events but this is not compatible with Component principles (do not modify used contract). For services, a solution is to create a services method manually which invoke the services from the targeted Component name, but this is uggly.
May be some solutions :
self myUsedComponentServices componentNamed: #componentB myServices
thisContext
to get the name of the emitterBeta Was this translation helpful? Give feedback.
All reactions