{"id":17188234,"url":"https://github.com/jclem/mutating-array","last_synced_at":"2025-10-27T00:23:19.131Z","repository":{"id":21894685,"uuid":"25218567","full_name":"jclem/mutating-array","owner":"jclem","description":"A mutating array for Ember","archived":false,"fork":false,"pushed_at":"2014-10-14T18:17:54.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T10:52:52.422Z","etag":null,"topics":[],"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/jclem.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2014-10-14T17:39:25.000Z","updated_at":"2014-10-14T18:04:35.000Z","dependencies_parsed_at":"2022-08-20T02:10:39.771Z","dependency_job_id":null,"html_url":"https://github.com/jclem/mutating-array","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fmutating-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fmutating-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fmutating-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fmutating-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jclem","download_url":"https://codeload.github.com/jclem/mutating-array/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245401374,"owners_count":20609163,"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":[],"created_at":"2024-10-15T01:08:27.808Z","updated_at":"2025-10-27T00:23:19.077Z","avatar_url":"https://github.com/jclem.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember.MutatingArray [![Build Status](https://travis-ci.org/jclem/mutating-array.svg?branch=master)](https://travis-ci.org/jclem/mutating-array)\n\n`Ember.MutatingArray` is an array mixin for Ember apps. It overrides the\n[`replace`][replace] method of an [Ember.MutableArray][mutable-array] so that\na series of filters, and then a series of maps, are performed on the array\nbefore any objects are added to it.\n\n## Install\n\n`bower install --save mutating-array`\n\n## Usage\n\n```javascript\n// Create an array\nvar arr = [\n  { firstName: 'Jonathan', lastName: 'Clem' },\n  { firstName: 'George', lastName: 'Jones' }\n];\n\n// Turn it into a MutatingArray\narr = Ember.MutatingArray.apply(arr);\n\n// Add some filters\narr.get('filters').pushObject(function onlyJoneses(item) {\n  return item.lastName === 'Jones';\n});\n\n// Add some maps\narr.get('maps').pushObject(function nickNames(item) {\n  if (item.firstName === 'George') {\n    item.nickname = 'The Possum';\n  }\n\n  return item;\n});\n\narr.toArray(); // [{ firstName: 'George', lastName: 'Jones', nickname: 'The Possum' }];\n\narr.pushObject({ firstName: 'George', lastName: 'Bush' });\n\narr.toArray(); // [{ firstName: 'George', lastName: 'Jones', nickname: 'The Possum' }];\n\narr.pushObject({ firstName: 'Chuck', lastName: 'Jones' });\n\narr.toArray(); // [\n               //   { firstName: 'George', lastName: 'Jones', nickname: 'The Possum' },\n               //   { firstName: 'Chuck', lastName: 'Jones' }\n               // ];\n```\n\n[replace]: http://emberjs.com/api/classes/Ember.MutableArray.html#method_replace\n[mutable-array]: http://emberjs.com/api/classes/Ember.MutableArray.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjclem%2Fmutating-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjclem%2Fmutating-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjclem%2Fmutating-array/lists"}