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
In the @cratis/applications package we have an object called Globals, this can be used to configure the current microservice. This is useful to be able to provide the x-cratis-microservice header or query parameter to commands and queries.
However, when running in a federated module scenario with this package being one of the shared packages, this becomes a global object for everyone and it is basically the last microservice that wins. In React we have the <ApplicationModel/> context that deals with this, which is good for React and hooks - however, when working with @cratis/applications.react.mvvm this quickly becomes a problem again, as it becomes problematic injecting commands or queries into view models.
We need an elegant solution to deal with this in a good way. We've invested in tsyringe as the IoC container. If we could get it to work with interception, we could basically intercept any resolved dependency and then call the setMicroservice() method on commands and queries relative to the current microservice.
The text was updated successfully, but these errors were encountered:
In the
@cratis/applications
package we have an object calledGlobals
, this can be used to configure the current microservice. This is useful to be able to provide thex-cratis-microservice
header or query parameter to commands and queries.However, when running in a federated module scenario with this package being one of the shared packages, this becomes a global object for everyone and it is basically the last microservice that wins. In React we have the
<ApplicationModel/>
context that deals with this, which is good for React and hooks - however, when working with@cratis/applications.react.mvvm
this quickly becomes a problem again, as it becomes problematic injecting commands or queries into view models.We need an elegant solution to deal with this in a good way. We've invested in tsyringe as the IoC container. If we could get it to work with interception, we could basically intercept any resolved dependency and then call the
setMicroservice()
method on commands and queries relative to the current microservice.The text was updated successfully, but these errors were encountered: