<div class="container">
		<div class="page-header">
				<h1>RxJS glitch demo</h1>
				As pointed out by Stephen Blackheath
				This should only print (1000*x + x), but is also prints the intermediate glitches <br/>
				<ul id="list"></ul>
		</div>
</div>
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/rxjs/4.1.0/rx.all.js"></script>-->
<script src="//cdnjs.cloudflare.com/ajax/libs/rxjs/5.4.3/Rx.js"></script>
function log(text) {
	const li = document.createElement("li");
	li.innerHTML = text;
	list.appendChild(li);
}

const list = document.getElementById("list");
const ticks = Rx.Observable.interval(100).take(10).share();
const sum = ticks.combineLatest(ticks, (oVal, hVal) => oVal + 1000 * hVal);
sum.subscribe(log);
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.