given a component, which displays a modal dialog (for instance a prompt wether a record should be deleted). When the delete button is pressed, it should display a running indicator until the operation is complete. So, we have something like this:
Then we have another component/controller that includes the dialog and has a task to actually delete the record:
hbs:
{{modal-dialog delete=(perform delete)}}
js:
delete: task(function * () {
yield this.version.destroyRecord();
// do some more stuff
})
This displays the following warning:
ember-concurrency detected a potentially hazardous "self-cancel loop" between parent task _ok and child task deleteVersion. If you want child task deleteVersion to be canceled when parent task _ok is canceled, please change .perform() to .linked().perform(). If you want child task deleteVersion to keep running after parent task _ok is canceled, change it to .unlinked().perform()
and seems to cancels all following statements after the yield statement.
I haven't been able to find out how linked or unlinked is supposed to work in this situation, as there is no actual {{linked}} helper, which could be used similar to the way perform is currently used.
Could you please provide some details how ember concurrency tasks can be shared between two components - similar to what can easily be done with plain ember actions? Or how do I get rid of this warning?
given a component, which displays a modal dialog (for instance a prompt wether a record should be deleted). When the delete button is pressed, it should display a running indicator until the operation is complete. So, we have something like this:
modal-dialog.hbs:
modal-dialog.js:
Then we have another component/controller that includes the dialog and has a task to actually delete the record: hbs:
{{modal-dialog delete=(perform delete)}}
js:
This displays the following warning:
and seems to cancels all following statements after the yield statement.
I haven't been able to find out how
linked
orunlinked
is supposed to work in this situation, as there is no actual{{linked}}
helper, which could be used similar to the wayperform
is currently used.Could you please provide some details how ember concurrency tasks can be shared between two components - similar to what can easily be done with plain ember actions? Or how do I get rid of this warning?