lundi 2 mars 2015

Why does cancelling a bluebird promise in a callback stop setInterval?


Promise = require 'bluebird'

cb = ->
console.log 'callback!'
p = Promise.resolve(5)
.cancellable()
.tap -> p.cancel()

setInterval(cb, 100)


The cb function only is only called once. Commenting out .tap -> p.cancel() allows it to run repeatedly. Adding a try block doesn't help. Perhaps this is something obvious, but I did some research and can't find an explanation.


Aucun commentaire:

Enregistrer un commentaire