Closed bergus closed 8 years ago
From the meeting notes:
With the proposal as it is: function delay(ms, cancelToken) { return new Promise((resolve, reject, cancel) => { const id = setTimeout(resolve, ms); if (!cancelToken) return; cancelToken.promise.then(cancelation => { cancel(cancelation); clearTimeout(id); }); }); } JHD: Would have to pass cancelation through that cancel function? DD: Yes
With the proposal as it is:
function delay(ms, cancelToken) { return new Promise((resolve, reject, cancel) => { const id = setTimeout(resolve, ms); if (!cancelToken) return; cancelToken.promise.then(cancelation => { cancel(cancelation); clearTimeout(id); }); }); }
JHD: Would have to pass cancelation through that cancel function?
DD: Yes
I'm confused, this does seem to contradict the current draft spec text. Wouldn't it need to be
function delay(ms, cancelToken) { return new Promise((resolve, reject) => { // no cancel callback const id = setTimeout(resolve, ms); if (!cancelToken) return; cancelToken.promise.then(cancelation => { reject(cancelation); // call reject() here clearTimeout(id); }); }); }
You even affirmed the cancel usage to Jordan. Do you plan to re-introduce this?
cancel
This appears to be bad meeting notes. I was trying to explain that the slides had a typo.
Ah, the mistake is also in the example here.
From the meeting notes:
I'm confused, this does seem to contradict the current draft spec text. Wouldn't it need to be
You even affirmed the
cancel
usage to Jordan. Do you plan to re-introduce this?