timer

RxJS 5 timer

by Brian Troncone

HTML

<script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.umd.js"></script>

JavaScript

//emit 0 after 1 second then complete, since no second argument is supplied
const source = Rx.Observable.timer(1000);
//output: 0
const subscribe = source.subscribe(val => console.log(val));