DEV Community

Discussion on: Polling using RxJS

Collapse
 
hoverbaum profile image
Hendrik

Also quite valid. To get around this you could use switchMap learnrxjs.io/operators/transformat....

It cancels running streams and prevents sending to many requests.

Collapse
 
qm3ster profile image
Mihail Malo

Seems like exactly the right tool.
Do you know of an example that uses real fetch cancellation together with switchMap?

Thread Thread
 
hoverbaum profile image
Hendrik

Sadly not. We haven't checked into it since the approach from this post hasn't created any trouble for us, yet.

Collapse
 
pappa profile image
Pappa

If all requests took longer than 500ms, wouldn't this approach just keep cancelling slow requests every 500ms, and never receive a response?