-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document interface of the host object expected by EC #360
Comments
For the most part, ember-concurrency just needs to know about For using For using the ember-concurrency <= 1.x is inextricably linked to the Ember Object model, and so the reason for these not being more documented for non-EmberObject use cases is primarily because historically it has been primarily focused on Components and it wasn't possible to use with POJOs (or at the very least things would behave oddly). However, in recent Ember releases (specifically since 3.10) this isn't so much the case and it is usable, for example with Glimmer components. Once #357 is merged, we could potentially add some typing for the host object to those type definitions too. ember-concurrency 2.x (still WIP, but there's an alpha release) uses a core that's not linked to Ember at all, and will allow us to work out the non EmberObject use-case going forward, and when that's ready there will likely be more documentation about use in this context. |
Thank you @maxfierke this is very useful! |
We should probably look into transitioning into https://github.com/ember-polyfills/ember-destroyable-polyfill instead of relying on |
oh nice, I didn't realize that RFC had been merged. I'll take a look at that later. |
Unless I missed something, there is no documentation of the interface that is expected from the host object. Here is the best I could find so far:
Most of the time I use EC tasks within
Ember.Component
orEmber.Service
sub-classes, but occasionally I find myself wanting to use it in vanilla classes (that do not expose theEmber.Object
orEmber.Evented
interfaces), and it's not clear what EC expects of the host object. I understand that among other things EC needs to be able to tell when the host object gets destroyed, but how it monitors the destruction of the host object is a mystery.More and more, the Ember leadership team is advocating against extending
EmberObject
so it would seem opportune for EC to document usage in a more vanilla context. It'd be great if the interface expected of the host object were documented in the API doc, or better yet formalized through a rigorously typedtask()
decorator in a TS declaration file.The text was updated successfully, but these errors were encountered: