首页 > 解决方案 > What happens to other observables when rxjs.race() has been won?

问题描述

Imagine we have couple Observables and we put them inside race() operator. When one of those will win others are cancelled or called 'complete' or what exactly? I haven't found any informations about it in official docs.

标签: javascripttypescriptrxjs

解决方案


Well, a quick dig in the docs shows that the rest of the observables will no longer be subscribed:

race: race() will no longer subscribe to subsequent observables if a provided source synchronously errors or completes. This means side effects that might have occurred during subscription in those rare cases will no longer occur.


推荐阅读