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
691 stars 157 forks source link

Add info about `context` for Encapsulated tasks docs. #419

Open esbanarango opened 3 years ago

esbanarango commented 3 years ago

When you have an Encapsulated task and you're using ember-concurrency < 2.0.0. You can access the "parent" context using this.owner. This was removed in the new versions and the docs does not mention anything about this.context for the new versions.

https://github.com/machty/ember-concurrency/pull/401

maxfierke commented 3 years ago

Neither this.context or this.owner were considered part of the public API, but in v0/v1 they were both set to the same thing. Most folks used this.context in encapsulated tasks, so that's the one that was restored. this.owner was confusing because it does not align with what a "owner" typically is in an Ember app and does not exist in v2.

As mentioned in #401, this.context is still not considered part of the public API and won't be documented, but likely will be made accessible via some new, blessed public API in the near-ish future (at which point this.context may disappear)