{"id":16318030,"url":"https://github.com/workmanw/ember-computed-sortby","last_synced_at":"2025-03-22T21:31:38.351Z","repository":{"id":57223593,"uuid":"42332118","full_name":"workmanw/ember-computed-sortby","owner":"workmanw","description":"Computed property implementation of `Ember.Array.sortBy`.","archived":false,"fork":false,"pushed_at":"2017-05-04T18:09:15.000Z","size":82,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T14:53:50.112Z","etag":null,"topics":["ember","ember-addon"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workmanw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-11T21:04:10.000Z","updated_at":"2024-05-30T03:02:10.000Z","dependencies_parsed_at":"2022-08-24T15:50:33.499Z","dependency_job_id":null,"html_url":"https://github.com/workmanw/ember-computed-sortby","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workmanw%2Fember-computed-sortby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workmanw%2Fember-computed-sortby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workmanw%2Fember-computed-sortby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workmanw%2Fember-computed-sortby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workmanw","download_url":"https://codeload.github.com/workmanw/ember-computed-sortby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245022565,"owners_count":20548559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ember","ember-addon"],"created_at":"2024-10-10T22:09:47.924Z","updated_at":"2025-03-22T21:31:38.090Z","avatar_url":"https://github.com/workmanw.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember-computed-sortby\n\nAddon to make sorting a little easier for Ember.js when the sort order is immutable. This addon was originally a proof of concept for [emberjs/rfcs#87](https://github.com/emberjs/rfcs/pull/87). However that RFC was rejected, so this will continue to live on as an addon.\n\n## Documentation\n\nA computed property which returns a new sorted array of content from the\na dependent array. The sort order is defined by the second, and any subsequent,\nstring arguments. Adding a suffix of ':desc' to any of those string arguments\nwill cause that order to be applied as descending.\n\nExample:\n\n```javascript\nimport sortBy from 'ember-computed-sortby';\n\nlet ToDoList = Ember.Object.extend({\n  // using standard ascending sort\n  sortedTodos: sortBy('todos', 'name'),\n\n  // using descending sort\n  sortedTodosDesc: sortBy('todos', 'name:desc'),\n\n  // using secondary sort\n  sortedPriority: sortBy('todos', 'priority', 'name')\n});\n\nlet todoList = ToDoList.create({todos: [\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Integration Test', priority: 2 },\n  { name: 'Release', priority: 1 }\n]});\n\ntodoList.get('sortedTodos');      // [{ name:'Documentation', priority:3 }, { name: 'Integration Test', priority: 2 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.get('sortedTodosDesc');  // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name: 'Integration Test', priority: 2 }, { name:'Documentation', priority:3 }]\ntodoList.get('priorityTodos');    // [{ name:'Release', priority:1 }, { name: 'Integration Test', priority: 2 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n```\nMethod documentation:\n```\n@method sort\n@for Ember.computed\n@param {String} itemsKey\n@param {String} property name(s) to sort on. Append ':desc' to trigger sort to be applied as descending.\n@return {Ember.ComputedProperty} computes a new sorted array based on the sort property array\n@public\n```\n\n## Installing this addon\n\nFrom within your Ember CLI project directory:\n```\nember install ember-computed-sortby\n```\n\n## Running Tests\n\n### Setup\n\n* `git clone` this repository\n* `yarn install`\n\n### Testing\n\n* `ember test`\n* `ember test --server`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkmanw%2Fember-computed-sortby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkmanw%2Fember-computed-sortby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkmanw%2Fember-computed-sortby/lists"}