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

Array helpers #185

Merged
merged 18 commits into from Jul 21, 2016
Merged

Array helpers #185

merged 18 commits into from Jul 21, 2016

Conversation

taras
Copy link
Contributor

@taras taras commented Jul 19, 2016

  • Added map helper
  • Added reduce helper
  • Added filter helper
  • Updated README

@@ -79,8 +79,11 @@ For action helpers, this will mean better currying semantics:
+ [`underscore`](#underscore)
+ [`w`](#w)
* [Array](#array-helpers)
+ [`array`](#array)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You moved array to the top, but didn't move the section in the document itself. Either move this one back, or move the section to the correct order. I'd prefer moving this entry back to it's original place, as I don't see the need why this needs to be moved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can move it back, but I think it should be at the top because it's one of the most primitive helpers in this list. People need to know that it's available. I'm sure they'll come across it eventually but why not put it at the top so it's right there.

@ghost
Copy link

ghost commented Jul 19, 2016

In summary:

  • The last argument to {{filter}} should always be the array
  • Use double quotes in HBS templates
  • Use this.on to set actions on the test context
  • Needs entries in addon/index.js

@taras
Copy link
Contributor Author

taras commented Jul 19, 2016

@martndemus I've done everything.


export default Helper.extend({
compute([callback, array]) {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@poteto sorry, I'm not sure what you mean. I checked for extra white space and I don't see it. I also looked at how filter-by is implemented and I don't see a difference there either. Could you please tell me what you'd like me to change about the whitespace.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think she means delete the empty line at L13

@poteto
Copy link
Collaborator

poteto commented Jul 20, 2016

Looks good, mostly minor formatting and all tests need precondition assertions

@taras
Copy link
Contributor Author

taras commented Jul 20, 2016

@poteto I've made the changes that you suggested.

@ghost
Copy link

ghost commented Jul 21, 2016

@taras you still need to fix changing this.set into this.on when setting actions on the test context.

- Removed empty line from beginning of compute method in filter, filter-by, map and reduce
- Replaced the remaining this.set with this.on
- Renamed actions called callback to semantically better names
@taras
Copy link
Contributor Author

taras commented Jul 21, 2016

@martndemus sorry, I missed a few this.sets. I went through all of them and replaced them with this.on in all of the tests that I added. Removed empty line from map, reduce, filter and filter-by.

});

this.render(hbs`
{{~#each (filter (action 'truthyFoo') array) as |item|~}}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use double quotes in HBS templates.

@ghost
Copy link

ghost commented Jul 21, 2016

If you can fix the double quotes issue and then squash all your commits into one, I think we're good to merge.

@taras
Copy link
Contributor Author

taras commented Jul 21, 2016

@martndemus done

@ghost
Copy link

ghost commented Jul 21, 2016

@taras Squash your commits please!

@poteto poteto merged commit e343fe5 into DockYard:master Jul 21, 2016
@poteto
Copy link
Collaborator

poteto commented Jul 21, 2016

You can squash PRs in Github @martndemus. I'm outside right now so can't make a release

@ghost
Copy link

ghost commented Jul 21, 2016

Published v0.27.0

@taras
Copy link
Contributor Author

taras commented Jul 21, 2016

Awesome. Thank you

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