eliminating-the-subscription-for-an-observable-example3
An example for "Eliminating the Subscription for an Observable in Several Ways" article ☞ https://goo.gl/asCv1B
by Nitay Neeman
HTML
<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script>
<script src="https://rawgit.com/eu81273/jsfiddle-console/master/console.js"></script>
JavaScript
Rx.Observable
.fromEvent(document, 'mousemove')
.throttleTime(250)
.take(7)
.subscribe(
(value) => console.log(`Emitted value: ${value}`),
(error) => console.error(error),
() => console.log('Completed')
);