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

Find better decorator names #20

Closed
ooflorent opened this issue Jun 3, 2015 · 11 comments
Closed

Find better decorator names #20

ooflorent opened this issue Jun 3, 2015 · 11 comments

Comments

@ooflorent
Copy link
Contributor

I liked previous decorator. While container is acceptable, root is too broad.
Maybe you (@gaearon) could rename root to provides or something similar.
Any thoughts?

@gaearon
Copy link
Contributor

gaearon commented Jun 3, 2015

Provider / Container?

@gaearon
Copy link
Contributor

gaearon commented Jun 3, 2015

If the issue is it looking weird in the App file, you can alias the import:

import { root as reduxRoot } from 'redux';

root kinda makes sense in the context of Redux. I want to make it clear there's a single root in most applications, and that stores wouldn't work across different roots. Maybe it's obvious though.

@gaearon
Copy link
Contributor

gaearon commented Jun 4, 2015

Let's rename <Root> (@root) to <Dispatcher> (@dispatcher).
Keep <Container> and @container.

Deal?

@ooflorent
Copy link
Contributor Author

I like naming my decorators as verbs, similarly to what you did with @performs or @provides.
But Dispatcher and dispatcher are ok.

@gaearon
Copy link
Contributor

gaearon commented Jun 4, 2015

Yeah.. I like verb decorators. But then I want them to map 1:1 to the components. And components as verbs seem bizarre.

@ooflorent
Copy link
Contributor Author

While I agree on keeping noun for components, I think it is acceptable to
have decorators that are not 1:1.

Florent Cailhol

@gaearon
Copy link
Contributor

gaearon commented Jun 5, 2015

More bikeshedding:

  • <Dispatcher>, @dispatcher; <Controller>, @controller
  • <Dispatcher>, @dispatch; <Controller>, @control
  • <Dispatcher>, @dispatcher; <Injector>, @injector
  • <Dispatcher>, @dispatch; <Injector>, @inject

Anything that you like?

@ooflorent
Copy link
Contributor Author

I really like @dispatch and @inject

@bsansouci
Copy link

I second @ooflorent on this one. Inject seems to describe more what's happening under the hood than control is.

@gaearon
Copy link
Contributor

gaearon commented Jun 5, 2015

What about <Provider>, @provide?
I like @inject but not very fond of <Injector>..

@gaearon
Copy link
Contributor

gaearon commented Jun 5, 2015

Out in 0.7.0.

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