The things you may not pay attention to but they are good to know
Prerequisites:You should be familiar with RxJS and have some practical experience in using it.
RxJS lib has two ways to wrap network request in Observable. And They have difference:
fromFetchfunction — uses the Fetch API to make an HTTP request.
2. ajaxfunction — use XhrHttpRequest under the hood
Both return Observable so we expect unfinished network request should be canceled on unsubscribe. Usually it works like that but there is small remark in the official documentation for fromFetch :
WARNING Parts of the fetch API are still experimental.
AbortController is required for this implementation to work and use cancellation appropriately.
Will automatically set up an internal AbortController in order to teardown the internal
fetch when the subscription tears down.
So beware if you use it in IE11 browser since AbortController is not supported there .