aurelia / cli

The Aurelia 1 command line tool. Use the CLI to create projects, scaffold components, and bundle your app for release.
MIT License
407 stars 133 forks source link

How to enable cancellation correctly? #1202

Closed Rossil2012 closed 1 year ago

Rossil2012 commented 1 year ago

When should I call "Promise.config({ cancellation: true })"?

  1. Anytime when I import bluebird:
    import { Promise } from "bluebird";
    Promise.config({ cancellation: true });
  2. Anytime when I create a Promise:
    import { Promise } from "bluebird";
    ...
    Promise.config({ cancellation: true });
    promA = new Promise(...);
    ...
    Promise.config({ cancellation: true });
    promB = new Promise(...);
  3. On the entrypoint:
    // index.ts
    import { Promise } from "bluebird";
    Promise.config({ cancellation: true });