{"id":20210495,"url":"https://github.com/lc-cn/obj-observer","last_synced_at":"2026-03-01T04:33:36.900Z","repository":{"id":58063305,"uuid":"529785366","full_name":"lc-cn/obj-observer","owner":"lc-cn","description":"js/ts 对象监听","archived":false,"fork":false,"pushed_at":"2023-01-13T00:50:27.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-12T10:12:31.889Z","etag":null,"topics":["javascript","observer","proxy","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/lc-cn.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":"2022-08-28T06:48:00.000Z","updated_at":"2023-09-07T11:40:26.000Z","dependencies_parsed_at":"2023-02-09T14:01:49.982Z","dependency_job_id":null,"html_url":"https://github.com/lc-cn/obj-observer","commit_stats":null,"previous_names":["liucl-cn/obj-observer"],"tags_count":0,"template":false,"template_full_name":"l-collect/ts-dev-template","purl":"pkg:github/lc-cn/obj-observer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fobj-observer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fobj-observer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fobj-observer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fobj-observer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lc-cn","download_url":"https://codeload.github.com/lc-cn/obj-observer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fobj-observer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29960253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"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":["javascript","observer","proxy","typescript"],"created_at":"2024-11-14T05:48:12.241Z","updated_at":"2026-03-01T04:33:36.883Z","avatar_url":"https://github.com/lc-cn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# obj-observer\njs/ts 对象监听\n\n1. 安装依赖\n```shell\nnpm install obj-observer\n# 或 npm i\n```\n2. 在需要的地方引入watch方法，监听对象或数组的变化\n```javascript\nimport {ref,watch} from 'obj-observer'\nconst obj=ref({test:123})\nconst dispose=watch(obj,\n    (value,oldValue)=\u003e{\n        console.log('trigger change',value,oldValue)\n    })\nobj.test='hi world' //'trigger change' {test:'hello world'} {test:'hi world'} \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flc-cn%2Fobj-observer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flc-cn%2Fobj-observer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flc-cn%2Fobj-observer/lists"}