race

signature: race(): Observable

Example 1: race with 4 observables
Example 2: race with an error
  1. import { of } from 'rxjs/observable/of';
  2. import { race } from 'rxjs/observable/race';
  3. //Throws an error and ignores the other observables.
  4. const first = of('first').pipe(
  5. delay(100),
  6. })
  7. );
  8. const second = of('second').pipe(delay(200));
  9. const third = of('third').pipe(delay(300));

Additional Resources

  • race
    :newspaper: - Official docs