SOURCE

const interval = rxjs.interval
const obs = interval(1000)
const subscription = obs.subscribe(console.log)

setTimeout(function () {
  subscription.unsubscribe()
}, 2000)
console 命令行工具 X clear

                    
>
console