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
Hello
I have created a generic component that takes an observable as input and launches it only when I need it (to gain performance). When I call api through the HttpClient of angular, it works very well. But when I use the MIService execute, I see that the M3 api calls run without any subscription on it.
Very simple example :
I looked at how the MIService was developed.
From the moment the "execute" method is called, it executes the http request directly and stores the result in an observable.
This can become very problematic and even generate big performance problems.
The text was updated successfully, but these errors were encountered:
Yes! This is indeed a bug. But fixing it may be considered a breaking change, as some existing application may depend on requests being fired without a subscribe(), since that is the way it has always worked.
Will look into this.
But in the meantime, as a workaround you could defer the execution. Example (not tested):
import{defer}from"rxjs";// This should not fire the requestconstresponse$=defer(()=>this.miService.execute({program: 'MNS150MI',transaction: 'LstUserData',}));// This fires the requestresponse$.subscribe(response=> ...)
Hello
I have created a generic component that takes an observable as input and launches it only when I need it (to gain performance). When I call api through the HttpClient of angular, it works very well. But when I use the MIService execute, I see that the M3 api calls run without any subscription on it.
Very simple example :
I looked at how the MIService was developed.
From the moment the "execute" method is called, it executes the http request directly and stores the result in an observable.
This can become very problematic and even generate big performance problems.
The text was updated successfully, but these errors were encountered: