This adds can-zone/timeout a plugin to create timeouts for when a Zone
should be completed.
You use it like:
var timeout = require("can-zone/timeout");
var TimeoutError = timeout.TimeoutError;
var zone = new Zone({
plugins: [timeout(5000)]
});
zone.run(function(){
setTimeout(function(){}, 10000);
}).catch(function(err){
// err instanceof TimeoutError
});
This adds
can-zone/timeout
a plugin to create timeouts for when a Zone should be completed.You use it like: