How to listen to any action sent by a component?


#1

Suppose that there is a component “my-component” that is sending (this.sendAction) two actions “foo” and “bar”.

There is any way that a parent component (“parent-component”) to register to any action issued by “my-component”? So “parent-component” can listen to both “foo” and “bar” without really knowing the name of the actions.

//parent-component.js
actions: {
   anyAction(actionName, context) {
      //code here
   }
}

//parent-component.hbs
{{my-component anyAction=(action 'anyAction')}}