daily pastebin goal
47%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Observable } from './Observable'
  2.  
  3. const interval = (timespan: number) =>
  4.   new Observable(({ next }) => {
  5.     let time = 0;
  6.     setInterval(() => {
  7.       next(time);
  8.       time += timespan;
  9.     }, timespan);
  10.   });
  11.  
  12. interval(1000).subscribe(console.log)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top