I have list, that should simulate the stream :
list = [
{name : \'Str1\', age: 10},
{name : \'Str2\', age: 10},
{n
Have you tried to use toArray
operator?.
let list = [
{ name: 'Str1', age: 10 },
{ name: 'Str2', age: 10 },
{ name: 'Str3', age: 10 },
{ name: 'Str4', age: 10 },
{ name: 'Str5', age: 10 },
{ name: 'Str6', age: 10 }
];
let currentPage = 2;
let pageSize = 2;
Rx.Observable.from(list)
.skip(currentPage * pageSize)
.take(pageSize)
.toArray()
.subscribe(data => console.log(data), console.error);