The last overload gave the following error.
Argument of type '{ onState: null; keepLatest: boolean; }' is not assignable to parameter of type 'EncapsulatedTaskDescriptor<any, any[]>'.
Object literal may only specify known properties, and 'onState' does not exist in type 'EncapsulatedTaskDescriptor<any, any[]>'.
3 @task({onState: null, keepLatest: false}) * exampleTask() : TaskGenerator<void> {
~~~~~~~~~~~~~
node_modules/ember-concurrency/addon/index.d.ts:873:17
873 export function task<T extends EncapsulatedTaskDescriptor<any, any[]>>(
~~~~
The last overload is declared here.
Creating a task with modifier
{onState: null}
:…generates the following typescript error:
Expected behavior from JSDoc is that
onState
should be nullable: https://github.com/machty/ember-concurrency/blob/9eff68cddb50ce10c58bf91f8aad90e0fc2df5d4/addon/-private/task-decorators.js#L180