I use Promises in an Angular (4) project, and I have a question about them that I cannot find the answer to in the docs.
When I create Promise, I basically wait for the async response from the service / member. But how long should I expect this promise to remain pending? Is there any mechanism that will stop it after some time? How reliable is this expectation / expectation concept?
Suppose that I need to get some data from the employment service that can respond even after a few minutes of waiting, maybe more, regardless of whether the calculation of the response is a resource-intensive process or this service is connected to another one that responds very slowly. Is there anything on the client side that somehow breaks my promise and determines / forces to create another one to request my data again?
Someone suggested upgrading to Observables, and I will do it, but for now I want to continue using Promises, at least for some areas of the code.
Tks a lot
source
share