machty/ember-concurrency-decorators

Question: Is there way to use EC tasks lifecycle events within EC decorators?

Closed this issue · 3 comments

The title actually describes my issue pretty well, what is the valid syntax for using modifiers?

Like:

someTask: task(function * () {
     yield stuff();
}).on('didInsertElement')

Can you try this?

class {
  @task({ on: 'didInsertElement' })
  *someTask() {
    // ...
  }
}

@buschtoens it works, thank you! It might be good to declare it in docs somehow, or did I miss something and it is already there? :)

Yes, you're right. It's not explicitly documented. In fact all modifiers "just work" even third-party ones, like ember-concurrency-test-waiter.