Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Add Enhancer for using Radium with ES6 classes #133

Merged
merged 5 commits into from
May 13, 2015

Conversation

ianobermiller
Copy link
Contributor

I'm not really sure about the naming conventions, but this is a "higher order component". I've also played around with the idea of calling it a Decorator, since it can be used as-is as an ES7 decorator (https://github.com/wycats/javascript-decorators). We might also consider exposing wrapUtils (to satisfy cases like #123), although I'm not sure it is worth expanding the API surface.

Fixes #122.

@alexlande
Copy link
Contributor

Finally played around with this and love it. Feels much nicer than the wrap method. Sorry about the merge conflict I introduced with the keyframes thing. :shipit:

@ianobermiller
Copy link
Contributor Author

How about naming? @colinmegill any comments here?

Some options:

  • Enhancer
  • Decorator
  • Wrapper (tad confusing since we have wrap, but also maybe consistent?)
  • HigherOrderComponent (far too wordy)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.82%) to 42.75% when pulling 7a204a2 on es6-class-enhancer into ea96cfa on master.

@ianobermiller
Copy link
Contributor Author

I'll add more tests for Enhancer once we have babel compilation support; it is hard to do stuff with classes without the class syntax :)

@coveralls
Copy link

Coverage Status

Coverage increased (+56.43%) to 100.0% when pulling 4386311 on es6-class-enhancer into ea96cfa on master.

@ianobermiller
Copy link
Contributor Author

I'll merge this now, and we can change the name afterward if we so desire.

ianobermiller added a commit that referenced this pull request May 13, 2015
Add Enhancer for using Radium with ES6 classes
@ianobermiller ianobermiller merged commit 6e37e5c into master May 13, 2015
@alexlande
Copy link
Contributor

Posthumous comment: I like Enhancer. Lines up with a lot of the other higher order component discussions I've seen. Decorator implies that it is specifically an ES7 decorator, which would be confusing. Wrapper is too similar to wrap. HigherOrderComponent is indeed too long.

@alexlande alexlande deleted the es6-class-enhancer branch May 13, 2015 21:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using Radium with ES6 components
3 participants