Last active
November 17, 2018 09:12
-
-
Save nlharri/45dfaa95d956a5224c0bd0a50431ce12 to your computer and use it in GitHub Desktop.
RxJS Tutorial - throttleTime()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { interval } = require('rxjs') | |
const { throttleTime } = require('rxjs/operators'); | |
// emit value every 500 millisecond (0.5 second) | |
const myObserver = interval(500); | |
const myThrottledObserver = myObserver.pipe(throttleTime(1000)); | |
myThrottledObserver.subscribe(val => console.log(val)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment