{"id":21465779,"url":"https://github.com/jsaaron/aaobserver","last_synced_at":"2025-07-15T04:31:42.533Z","repository":{"id":14906794,"uuid":"17630750","full_name":"JsAaron/aaObserver","owner":"JsAaron","description":"简单的自定义事件，观察者模式","archived":false,"fork":false,"pushed_at":"2014-03-14T14:50:16.000Z","size":140,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T22:14:29.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/JsAaron.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":"2014-03-11T13:09:34.000Z","updated_at":"2021-12-17T18:26:28.000Z","dependencies_parsed_at":"2022-09-24T00:24:58.388Z","dependency_job_id":null,"html_url":"https://github.com/JsAaron/aaObserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JsAaron/aaObserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JsAaron%2FaaObserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JsAaron%2FaaObserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JsAaron%2FaaObserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JsAaron%2FaaObserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JsAaron","download_url":"https://codeload.github.com/JsAaron/aaObserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JsAaron%2FaaObserver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265402833,"owners_count":23759237,"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-11-23T08:11:58.627Z","updated_at":"2025-07-15T04:31:42.294Z","avatar_url":"https://github.com/JsAaron.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"aaObserver\n==========\n\n简单的自定义事件，观察者模式\n\n\n    var object = {}\t\t\n\n    //赋予自动事件的能力\n    Observer.call(object)\t\t\n\n    //订阅\n    object.subscribe('aaaa',function(){\t\t\n    \tconsole.log('订阅了aaa')\n    \treturn '返回值'\n    })\n\n    object.subscribe('bbbb',function(){\t\t\n\tconsole.log('订阅了bbbb')\n\treturn '返回值'\n    })\n\n    //执行,并且得到返回值\t\t\n    //r得到返回值\n    var r = object.publish('aaaa');\n        object.publish('bbbb');\n\n    //移除\n    object.remove('aaaa');\n    object.remove('bbbb');\n \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsaaron%2Faaobserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsaaron%2Faaobserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsaaron%2Faaobserver/lists"}