Skip to content

promisified function does not trigger setScheduler #1023

Description

@sterling

bluebird 3.3.3, Chrome 48, angular 1.5.0

Example in this fiddle: https://jsfiddle.net/Lmac0kLw/5/

When using promisify on an async function, it appears that setScheduler is not called when the promise resolves. In my jsfiddle, I use angular to update the text to HelloWorld, but it does not change.

There are a few ways to remedy this:

  1. Add a $scope.$apply(); which obviously defeats the purpose of setScheduler.
  2. Use a normal promise in place of pAsync:
Promise.resolve()
  .then(function() {
    $scope.hello = 'HelloWorld';
  });

As I understand it, there should be no difference between the promisified call vs the normal promise. Is this an actual bug? Or am I not understanding something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions