ember-lifeline
ember-lifeline copied to clipboard
Type miss-match between `runTask` and `cancelTask`
Right now if we do
const timerId = runTask(this, () => {}, 100);
cancelTask(this, timerId);
We will get the following error
Argument of type 'Timer' is not assignable to parameter of type 'EmberRunTimer'.
Type 'number' is not assignable to type 'EmberRunTimer'.ts(2345)
Not sure exactly if runTask
signature is wrong or are the arguments for cancelTask
wrong but I'm definitely sure the types should match
ps. this probably relates to https://github.com/ember-lifeline/ember-lifeline/issues/876
Also I'd recommend rewritting tests to TS to prevent such type regressions in the future
we have a couple of places in our code base.
where I see people doing cancelTask(this, this._runTaskId as unknown as EmberRunTimer);
because of the mismatch