skip

signature: skip(the: Number): Observable

Example 1: Skipping values before emission

Example 2: Short hand for a specific filter use case

  1. import { skip, filter } 'rxjs/operators';
  2. const numArrayObs = from([1,2,3,4,5,6,7,8,9,10]);
  3. // 3,4,5...
  4. const skipObs = numArrayObs.pipe(skip(2))
  5. // 3,4,5...
  6. const filterObs = numArrayObs.pipe(
  7. filter((val, index) => index > 1)
  8. )
  9. .subscribe(console.log);
  10. //Same output!