Fix sub?.removeAllListeners is not a function (#1469)
This commit is contained in:
parent
41da95b125
commit
7eaaa7ce44
|
@ -34,7 +34,10 @@ function subscribeForever (subscribe) {
|
|||
}
|
||||
if (sub.then) {
|
||||
// sub is promise
|
||||
sub.then(sub => sub.on('error', reject))
|
||||
sub.then(resolved => {
|
||||
sub = resolved
|
||||
sub.on('error', reject)
|
||||
})
|
||||
} else {
|
||||
sub.on('error', reject)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue