Closed ccummings closed 8 years ago
can-zone's setTimeout only passes the callback and delay to window.setTimeout here.
window.setTimeout
setTimeout can be passed parameters that should be passed through to the callback.
setTimeout
This PR makes sure all arguments are passed to setTimeout; making sure the first argument is the waitsFor function can-zone creates.
waitsFor
Example
var Zone = require("can-zone"); var zone = new Zone(); zone.run(function(){ setTimeout(function(str1, str2){ zone.data.foo = str1 + "-" + str2; //-> undefined-undefined }, 100, "can-zone", "canjs") }).then(function(data){ console.log(data.foo); });
Thanks!
Published as 0.5.7.
can-zone's setTimeout only passes the callback and delay to
window.setTimeout
here.setTimeout
can be passed parameters that should be passed through to the callback.This PR makes sure all arguments are passed to setTimeout; making sure the first argument is the
waitsFor
function can-zone creates.Example