{"id":15486247,"url":"https://github.com/positlabs/model-o","last_synced_at":"2025-08-01T23:44:10.959Z","repository":{"id":57300391,"uuid":"73585201","full_name":"positlabs/model-o","owner":"positlabs","description":"Simple observable model. Fires change events when values are assigned.","archived":false,"fork":false,"pushed_at":"2017-11-29T18:53:41.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-04T05:40:16.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/positlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-12T23:45:51.000Z","updated_at":"2016-11-13T00:37:15.000Z","dependencies_parsed_at":"2022-09-08T16:50:46.855Z","dependency_job_id":null,"html_url":"https://github.com/positlabs/model-o","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/positlabs/model-o","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/positlabs%2Fmodel-o","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/positlabs%2Fmodel-o/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/positlabs%2Fmodel-o/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/positlabs%2Fmodel-o/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/positlabs","download_url":"https://codeload.github.com/positlabs/model-o/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/positlabs%2Fmodel-o/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268314687,"owners_count":24231031,"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-08-01T02:00:08.611Z","response_time":67,"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-10-02T06:07:18.101Z","updated_at":"2025-08-01T23:44:10.903Z","avatar_url":"https://github.com/positlabs.png","language":"HTML","readme":"# model-o\n\nSimple observable model. Fires change events when values are assigned. Get excited!\n\n[![npm version](https://badge.fury.io/js/model-o.svg)](https://badge.fury.io/js/model-o)\n\n`npm install --save model-o`\n\n[View the demo](https://positlabs.github.io/model-o/)\n\n## usage\n\n```javascript\n\n\tvar model = new Model_O({\n\t\tstr: 'hello',\n\t\tobj: {\n\t\t\ta: 'a' // NOTE: unwatchable\n\t\t},\n\t\tsubModel: new Model_O({\n\t\t\ta: 'a' // watchable\n\t\t}),\n\t\tbool: true,\n\t\tnum: 123.4567,\n\t\tarr: [1, 2, 3, 4, 5]\n\t})\n\n\tconsole.log(model)\n\n\tvar onChange = function(newval, oldval, key){\n\t\tconsole.log(key, 'newval: ' + newval + ', oldval: ' + oldval)\n\t}\n\tmodel.on('str', onChange)\n\tmodel.str = 'asdf'\n\tmodel.str += 'asdf'\n\n\tmodel.subModel.on('a', onChange)\n\tmodel.subModel.a = 'A'\n\n\tmodel.on('arr', onChange)\n\tmodel.arr = model.arr.concat('extra')\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpositlabs%2Fmodel-o","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpositlabs%2Fmodel-o","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpositlabs%2Fmodel-o/lists"}