SOURCE

// let su = new rxjs.Subject()
// console.log('nihao1')
// su.subscribe(console.log);
// su.next('nihao3')
// console.log('nihao2')

// let nn = Promise.resolve('niahoP1');
// nn.then(console.log)
// console.log('niahoP2')

let {map, switchMap} = rxjs.operators;
let { Subject } = rxjs;
let ss = new Subject();
ss.pipe(
    // switchMap(value => {
    //     return Promise.resolve(value)
    // }),
    map(value => {
        console.log(value,'keys')
        console.log(value.b.c)
        return value
    })
).subscribe({
    complete: console.log,
    // error: console.log,
    next: console.log
})
ss.next('ss')

setTimeout(() => {
ss.next(2);
console.log('后面这行应该也不会执行了1')
}, 2000)

setTimeout(() => {
 ss.next({b:{c: 'name'}})
console.log('后面这行应该也不会执行了2')
}, 5000)

// ss.next({b:{c: 'name'}})
console 命令行工具 X clear

                    
>
console