Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RxJS iterate over an array by time
const keyInputs = [
['n', 1],
['e', 10],
['w', 100],
[' ', 1],
['y', 10],
['o', 100],
['r', 300],
['k', 200]
];
Rx.Observable.from(keyInputs)
.concatMap(([key, delayFor]) => Rx.Observable.of(key).delay(delayFor))
.subscribe(d => console.log(d));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.