{"id":20077627,"url":"https://github.com/digitaledgeit/js-observable-collection","last_synced_at":"2025-11-28T05:05:22.192Z","repository":{"id":30031305,"uuid":"33580281","full_name":"digitaledgeit/js-observable-collection","owner":"digitaledgeit","description":"Ann `Array` wrapper that emits events when the `Array` is modified.","archived":false,"fork":false,"pushed_at":"2015-04-19T15:14:47.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T12:34:43.400Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitaledgeit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-08T02:31:37.000Z","updated_at":"2015-04-19T15:14:49.000Z","dependencies_parsed_at":"2022-09-07T18:11:07.415Z","dependency_job_id":null,"html_url":"https://github.com/digitaledgeit/js-observable-collection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/digitaledgeit/js-observable-collection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitaledgeit%2Fjs-observable-collection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitaledgeit%2Fjs-observable-collection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitaledgeit%2Fjs-observable-collection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitaledgeit%2Fjs-observable-collection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitaledgeit","download_url":"https://codeload.github.com/digitaledgeit/js-observable-collection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitaledgeit%2Fjs-observable-collection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27297012,"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","status":"online","status_checked_at":"2025-11-28T02:00:06.623Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-13T15:09:23.993Z","updated_at":"2025-11-28T05:05:22.169Z","avatar_url":"https://github.com/digitaledgeit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# observable-collection\n\nAn `Array` wrapper that emits events when the underlying `Array` is modified.\n\n## Installation\n\n    $ npm install --save digitaledgeit-observable-collection\n\n## Usage\n    \n    var collection = require('digitaledgeit-observable-collection');\n    \n    function update(item, index) {\n      //update the view\n    }\n    \n    collection()\n      .on('added',    update)\n      .on('removed',  update)\n      .on('emptied',  update)\n      .append({name: 'Bill'})\n      .append({name: 'Mark'})\n      .prepend({name: 'Steve'})\n      .each(function(item) {\n        console.log(item);\n      })\n    ;\n\n## API\n\n### new Collection()\n\nCreate a new collection.\n\n### Properties\n\n#### .first : *\n\nGet the first item in the collection.\n\n#### .last : *\n\nGet the last item in the collection.\n\n#### .empty : boolean\n\nCheck whether the collection is empty.\n\n#### .length : number\n\nGet the length of the collection.\n\n### Methods\n\n#### .at(index : number) : *\n#### .contains(item : *) : boolean\n#### .indexOf(item : *) : number\n#### .prepend(item : *)\n#### .append(item : *)\n#### .remove(item : *)\n#### .removeAt(index : number)\n#### .removeAll()\n#### .each(fn : function)\n#### .find(fn : function) : *\n#### .toArray() : Array\n#### .toString() : string\n\n### Events\n\n#### #added\n- item\n- index\n\n#### #removed\n- item\n- index\n\n#### #emptied\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitaledgeit%2Fjs-observable-collection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitaledgeit%2Fjs-observable-collection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitaledgeit%2Fjs-observable-collection/lists"}