有一种名为pipe的方法。请考虑下面的代码:
class S extends stream.Transform {
constructor () {
super({objectMode: true})
}
_transform (data, enc, cb) {
console.log('vm', data, enc)
this.push(null, data)
cb()
}
}
var s = new S()
factors // just a stream of some objects
.do((x) => console.log(x)) // I see an object here
.pipe(s) // but here the object casts to string
如何强制Rx不要忽略objectMode
?