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) {
return new Promise(function (resolve, reject) {
this._state.frame.cb = (len) => {
this._state.counter++;
this._storeState();
return resolve();
};
});
}
else {
return new Promise(function (resolve, reject) {
this._state.frame.cb = (len) => {
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()
}
}
if (dir) {
return new Promise (function (resolve, reject) {
this._state.frame.cb = (len : number) => {
this._state.counter++;
this._storeState();
this._state.counter++
this._storeState()
return resolve()
}
})
} else {
return new Promise (function (resolve, reject) {
this._state.frame.cb = (len : number) => {
this._state.counter--;
this._storeState();
this._state.counter--
this._storeState()
return resolve()
}
})
}
}