Using nodejs and typescript to review another answer to a different question, I get this exception:
TypeError: interval$.zip is not a function
My code (rxjs2.ts):
{
var Rx = require('rxjs');
const interval$ = Rx.interval(1000);
const items$ = Rx.from([1,2,3]);
const itemsOverTime$ = interval$.zip(items$).repeat();
itemsOverTime$.subscribe(([time, val]) => {
console.log(val);
// 1
// 2
// 3
// 1
// 2
// 3
});
}
Running this from VSCode console, like: node rxjs2.ts
My package-lock.json
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"@types/node": {
"version": "10.12.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.2.tgz",
"integrity": "sha512-53ElVDSnZeFUUFIYzI8WLQ25IhWzb6vbddNp8UHlXQyU0ET2RhV5zg0NfubzU7iNMh5bBXb0htCzfvrSVNgzaQ=="
},
"rxjs": {
"version": "6.3.3",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz",
"integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==",
"requires": {
"tslib": "1.9.3"
}
},
"tslib": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
}
}
}