Guest User

Untitled

a guest
Feb 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import { zip } from 'rxjs/observable/zip';
  2. import { interval } from 'rxjs/observable/interval';
  3. import { from } from 'rxjs/observable/from';
  4.  
  5. import { delay } from 'rxjs/operators';
  6.  
  7. // Delay per-item. Also automatically completes once `from` completes
  8. zip(
  9. from([1, 2, 3]),
  10. interval(1000),
  11. ).subscribe(([val]) => console.log(val));
  12.  
  13. // Delay only once
  14. from([4, 5, 6]).pipe(delay(1000)).subscribe(console.log);
Add Comment
Please, Sign In to add comment