I'm trying to use Bluebird alongside Angular 1.4 to replace Angular's $q (a la this suggestion).
I found that actions taken in a promise.then handler don't always get digested unless I trigger a digest cycle. I stepped around the Bluebird code a bit to see how the result of setScheduler was used, and it seems to be honored only if async._trampolineEnabled is true. And if I'm reading the code correctly, use of Promise.longStackTraces() in Chrome automatically disables the trampoline.
I'm new to this project so don't know the history with the trampoline, the Async abstraction, etc but I think I agree with the spin in the README.md on the sync build: don't use it (i.e. things are best with the trampoline enabled).
Also I noticed that calling Promise.enableTrampoline() implicitly re-enables the default scheduler, so if Promise.setScheduler() had previously been set, now it won't be.
Is it possible to make these features (long stack traces and setScheduler) work better together? (I see #542 but I don't know what the issue was there and the link is broken so it's hard to piece together the story starting now).
I'm trying to use Bluebird alongside Angular 1.4 to replace Angular's $q (a la this suggestion).
I found that actions taken in a promise.then handler don't always get digested unless I trigger a digest cycle. I stepped around the Bluebird code a bit to see how the result of setScheduler was used, and it seems to be honored only if
async._trampolineEnabledis true. And if I'm reading the code correctly, use ofPromise.longStackTraces()in Chrome automatically disables the trampoline.I'm new to this project so don't know the history with the trampoline, the Async abstraction, etc but I think I agree with the spin in the README.md on the sync build: don't use it (i.e. things are best with the trampoline enabled).
Also I noticed that calling
Promise.enableTrampoline()implicitly re-enables the default scheduler, so ifPromise.setScheduler()had previously been set, now it won't be.Is it possible to make these features (long stack traces and setScheduler) work better together? (I see #542 but I don't know what the issue was there and the link is broken so it's hard to piece together the story starting now).