Frame must return a promise for sequence to work. For any of it, really.

This commit is contained in:
mmcwilliams 2019-10-30 23:27:09 -04:00
parent 0f57c1c630
commit 5b0d120275
3 changed files with 30 additions and 17 deletions

View File

@ -448,16 +448,22 @@ class Intval {
} }
} }
if (dir) { if (dir) {
this._state.frame.cb = (len) => { return new Promise(function (resolve, reject) {
this._state.counter++; this._state.frame.cb = (len) => {
this._storeState(); this._state.counter++;
}; this._storeState();
return resolve();
};
});
} }
else { else {
this._state.frame.cb = (len) => { return new Promise(function (resolve, reject) {
this._state.counter--; this._state.frame.cb = (len) => {
this._storeState(); this._state.counter--;
}; this._storeState();
return resolve();
};
});
} }
} }
/** /**

File diff suppressed because one or more lines are too long

View File

@ -524,16 +524,23 @@ export default class Intval {
this._startBwd() this._startBwd()
} }
} }
if (dir) { if (dir) {
this._state.frame.cb = (len : number) => { return new Promise (function (resolve, reject) {
this._state.counter++; this._state.frame.cb = (len : number) => {
this._storeState(); this._state.counter++
} this._storeState()
return resolve()
}
})
} else { } else {
this._state.frame.cb = (len : number) => { return new Promise (function (resolve, reject) {
this._state.counter--; this._state.frame.cb = (len : number) => {
this._storeState(); this._state.counter--
} this._storeState()
return resolve()
}
})
} }
} }