使用转换函数
const source = Rx.Observable.range(1, 3)
.map(x => x * x);
const subscription = source.subscribe(
x => console.log(`Next: ${x}`),
err => console.log(`Error: ${err}`),
() => console.log(`Completed`)
);
// => Next: 1
// => Next: 4
// => Next: 9
// => Completed