Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add this.sendRouteAction() #64

Open
kellyselden opened this issue Jul 2, 2017 · 2 comments
Open

add this.sendRouteAction() #64

kellyselden opened this issue Jul 2, 2017 · 2 comments

Comments

@kellyselden
Copy link
Contributor

For components that are JS heavy without a template, they currently use this.sendAction() to send actions. Perhaps an analogous this.sendRouteAction() from this lib would be appropriate.

@buschtoens
Copy link

In the issue linked above, I've raised some concerns that are relevant to this discussion as well, so I'll cross post them here.

In my opinion, this generally isn't a good design pattern. I would much rather prefer to explicitly pass the route action as an attribute:

{{my-component action=(route-action "actionName")}}

Just by looking at the component invocation in the template, the user should be able to judge what's going in and what's coming out of a component (DDAU). This way components remain completely agnostic and make no assumptions about the environment they are invoked in.

Calling routeAction inside a component is really non-transparent and promotes an unhealthy invisible entanglement.

On the other hand, you can already call (route-action) in the component's template.

Because of that, I think we can go ahead and implement it. Just because it's there, doesn't mean you have to use it. 😜

@BennyAlex
Copy link

This function would be really nice, for example in the application-route we have a methode to refresh the model. If we need to refresh the model inside a component, it would be cleaner to call directly this.sendRouteAction() instead of passing it explicily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants