I am looking for a way to disregard the response from my API in case it takes too long to fetch. Currently, I am using
this.http.get(mysqlUrl).subscribe()
to retrieve the response. However, I would like to terminate that subscription if it exceeds a duration of 5 seconds. I understand that unsubscribe() can be used for this purpose, but how do I associate it with a timeout value?
Appreciate any help on this matter!