ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Add to check a subscription on action

Open andriictkn opened this issue 11 years ago • 1 comments

It would be great to have method that could check - has controller subscription for action or no. For now, when I try to trigger parent action I can check it by _.has(controller._actions, actionName) if expression true I trigger action with dependency data or no if I receive false.

For example my propose is create new method something like this:

this.hasAction('actionName')

andriictkn avatar Jul 16 '15 21:07 andriictkn

@AndreyUtka - perhaps adding a 'check subscription of action' feature would be worth discussing on the RFCs repo. You can raise the question as an issue on the RFC repo to start the process for considering new API support for your idea, see https://github.com/emberjs/rfcs/blob/master/README.md#gathering-feedback-before-submitting

Also, I've heard this type of request once before it may be nice to get a thread going in the http://discuss.emberjs.com forums or ask around in the embercommunity.slack.com group to see other patterns people use aside from checking if a subscription already exists prior to sending the action.

I think the design around throwing an error was intentional. It seems like more discussion is needed in order to make a case for the 'check subscription of action' support.

pixelhandler avatar Jul 25 '15 00:07 pixelhandler