ember-concurrency-decorators
ember-concurrency-decorators copied to clipboard
Add ability to specify multiple events
The .on() and .cancelOn() task modifiers are variadic, accepting a list of trigger events. Currently, ember-concurrency-decorators only allows specifying a single event, e.g
@task({ on: 'start', cancelOn: 'stop' })
This PR retains that API and adds the ability to specify multiple events as an array:
@task({ on: 'start', cancelOn: 'stop' }) // existing API is retained
@task({ on: ['start', 'go'], cancelOn: ['stop', 'bye'] }) // can now specify multiple events
@task({ on: ['start'], cancelOn: ['stop'] }) // also valid
I have updated the types to only accept an array if the modifier method accepts more than one parameter:
@task({ drop: [true] }) // type error
@task({ maxConcurrency: [1] }) // type error
@task({ group: ['foo'] }) // type error
@chancancode @maxfierke @dfreeman @chriskrycho
Are there runtime tests for this repo at all? If so, do we need to update those as well?
@chancancode there are some basic runtime tests, but they are very incomplete. I'm not sure why CI is failing. Tests are passing locally.