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 155 forks source link

Simplify async fn API to just `task(async () => {})` #477

Closed machty closed 1 year ago

machty commented 1 year ago

Having just released the new API for task(this, async () => {}), it dawned on me that with a bit more babel transform magic, we can support an even simpler task API of just:

myTask = task(async () => {
  // ...
})

rather than having to pass in this as the first arg. This seems like an obvious additional win.

jamescdavis commented 1 year ago

@machty Can you deploy the docs changes? 🙂

machty commented 1 year ago

@jamescdavis just pushed it now, thanks for the reminder. I can't believe how long the short-lived this-based documentation was live :(