machty / ember-concurrency

ember-concurrency is an Ember Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks.
http://ember-concurrency.com
MIT License
690 stars 157 forks source link

Types: Make Task, TaskInstance, and TaskGroup extend EmberObject #363

Closed jamescdavis closed 4 years ago

jamescdavis commented 4 years ago

A Task is an EmberObject: https://github.com/machty/ember-concurrency/blob/d066cd71a9e6abb8c749d931e971004a9930c587/addon/-task-property.js#L53-L55

This is important because the task state properties are computed properties, e.g. https://github.com/machty/ember-concurrency/blob/d066cd71a9e6abb8c749d931e971004a9930c587/addon/-task-state-mixin.js#L14-L22 and require using .get() to access them in Ember < 3.1.

Update: TaskInstance and TaskGroup are also EmberObjects so I've included them as well.

@chancancode @dfreeman @chriskrycho

chancancode commented 4 years ago

Should TaskInstance be updated too?

jamescdavis commented 4 years ago

Yep!: https://github.com/machty/ember-concurrency/blob/d066cd71a9e6abb8c749d931e971004a9930c587/addon/-task-instance.js#L798

Also TaskGroup: https://github.com/machty/ember-concurrency/blob/2b9c8c40979ff42e2449fde0c9ca7e985e023691/addon/-task-group.js#L35

I can add these here.