-
Notifications
You must be signed in to change notification settings - Fork 7
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 SliceColor helper #1239
Add SliceColor helper #1239
Conversation
✅ Deploy Preview for ember-simple-charts ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great cleanup!
@@ -0,0 +1,13 @@ | |||
import { helper } from '@ember/component/helper'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this needs to be a "helper". Could just be a plain function in src/utils/slice-color.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there more overhead to it being a "helper"? I assumed this was more of the Ember way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The helper
part usually means it's wrapped up in some kind of code to make it usable in a template. I don't really know exactly what that is. Want to dig into it a bit and see what you turn up? I'm ok to merge as is. Your call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From https://discuss.emberjs.com/t/best-practice-what-helpers-might-do/14431/2?u=michaelchadwick:
A helper should generally be a simple function that returns a value that is meant to be used in a template.
I suppose it is overkill to have it in a helper when it's not used in the template, so I'll refactor.
Helps clean up redundant code to determine the slice color in
Bar
,Donut
,HorzBar
, andPie
chart types