-
Notifications
You must be signed in to change notification settings - Fork 27
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
Any plans to addsum
helper?
#40
Comments
Is there any appreciable difference between that and |
@skeate No, there is none, I just did not see the |
@skeate, can you use the A sum helper would be great for this, if |
I just tried this with
If there were some kind of splat method widely available the |
If I make a PR, would it be welcomed? |
This would be trivial with a spread operator, which is in RFC: emberjs/rfcs#184 though that appears to be more focused on named arguments, and thus (if they don't see a use case for it) might not be implemented to support arrays. I still don't agree with adding a separate This should be doable with ember-composable-helpers, though. Perhaps One possibility for this addon would be to just do some typechecking. If we have one param and it's an array, return the sum of that. That does lead to "well why not flatten any arrays passed", and suddenly we're in space where behavior is not completely intuitive. |
I was trying to test this out, but couldn't get it to work as you mentioned. Shelfing it for now though as I no longer need it for my use-case. |
I think having this could be useful:
The text was updated successfully, but these errors were encountered: