Skip to content

0.6.15

Choose a tag to compare

@matthewp matthewp released this 17 Nov 20:48
· 77 commits to master since this release

This is a minor release, adding the following features:

Subclassable Zone

The Zone constructor can now be subclassed. This is useful in case you need to isolate Zone.current when run in an environment where you can't capture async tasks by calling a function. An example would be if using iframes:

var Zone = require("can-zone");

var SubZone = class extends Zone {};

var zone = new SubZone();
SubZone.current = zone;

// Now you can do stuff with `zone` and it won't touch
 `Zone.current`.

Break on timeout

You can now get a debugger; statement when using can-zone/debug, allowing you to step into code that is preventing the zone's run promise from resolving.

var Zone = require("can-zone");

var zone = new Zone([
  debug(5000, { break: true });
]);

break on timeout

New documentation

Some missing documentation was added for:

  • afterTask: A hook that is called at the end of a Task.
  • globals: A property on the ZoneSpec that allows you to specify globals that should be replaced inside of the zone.

Issues