Last active
January 30, 2020 21:03
-
-
Save GeorgDangl/3e87c41e0abf3b9ec79b99d7ad8db8e0 to your computer and use it in GitHub Desktop.
Cancel Obsolete Http Requests in Rx.NET with the Switch Operator, see https://blog.dangl.me/archive/cancel-obsolete-http-requests-in-rxnet-with-the-switch-operator/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_requestUrl | |
.Subscribe(async url => | |
{ | |
var response = await httpClient.GetAsync(url); | |
// Update the list | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_requestUrl | |
.Select(url => httpClient.GetAsync(url)) | |
.Switch() | |
.Subscribe(response => | |
{ | |
// Update the list | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment