Closed oskarrough closed 6 years ago
Adds a generic {{sort-by}} component to sort stuff. For now I only added it to label releases.
Example:
{{#sort-by model "year" "desc" as |sortedModel|}} {{#each model as |item|}} ... {{/sort-by}}
Instead of a component we could write a helper, which would be a lot less typing. This is what https://github.com/DockYard/ember-composable-helpers does but I did not want to add a dependency yet/
{{#each-list (sort-by model "year" "desc") as |item|}} {{item.title}} {{/each-list}}
OR, we could add it to each controller but since we need it in so many places a template option looks more tasty.
Changed the PR to use a helper instead of a component. Feel easier, less {{}} nested templates.
Adds a generic {{sort-by}} component to sort stuff. For now I only added it to label releases.
Example:
Alternatives
Instead of a component we could write a helper, which would be a lot less typing. This is what https://github.com/DockYard/ember-composable-helpers does but I did not want to add a dependency yet/
OR, we could add it to each controller but since we need it in so many places a template option looks more tasty.