I have an array which I'd like to filter.. sounds simple I know. But when I do, I still get the entire Array...
constructor(http:Http) {
this._val = Math.random();
let s = http.get('https://secure.digitalsignage.com/Digg');
s.map(s => {
let news = JSON.parse(s._body);
return Rx.Observable.fromArray(news);
}).filter(function(data) {
console.log('all array ' + data);
return true;
}).subscribe(function (v) {
console.log(v);
});
}
so in console.log('all array ' + data); I am getting the entire array instead of a stream of individual array members, why?
here is debug snap:
I know I am not crazy because this works as expected:
Rx.Observable.fromArray([1, 2, 3, 4, 5]).filter(function (v) {
if (v < 3)
return true
return false;
}).subscribe(function (v) {
console.log(v);
})
what gives?
tx for reading,
Sean.
