Reactive-Extensions / RxJS

The Reactive Extensions for JavaScript
http://reactivex.io
Other
19.49k stars 2.1k forks source link

🐐 Replace joins for loop with a .find array opt. #1532

Open samccone opened 6 years ago

samccone commented 6 years ago

The intent of the for loop in this case was to find (if present) an entity in the joinObserveArray who's queue has no elements, when that element was found hasValues was set to false and the for loop was exited.

The semantics of this code can be replaced with a more "idiomatic" find operation which will do the following:

  1. loop over each element until an element is found
  2. return the found element which can be used to set hasValues to false;

Thanks so much for your time reviewing this PR and have a great day!