In my angular apps, I want to show a text/modal that have a cancel and reload button, when the server responds slowly.
If the user click cancel, current http request will be cancelled. If the user click reload, current http request will be retried. If the text/modal already shown and the HTTP request already respond/completed, then the text/modal should disappear.
I have an idea using HTTP interceptor, RxJS, and global service, but implementing it is not that easy.
Is there anyone who have an idea, how to do this the right way?
EDIT: Oh and I want to make it a generic module so every http request can be cancellable or reloadable. So every page could have this functionality