{"id":18524790,"url":"https://github.com/iminside/js.event_emitter","last_synced_at":"2025-07-03T13:03:40.318Z","repository":{"id":57283920,"uuid":"42499672","full_name":"iminside/js.event_emitter","owner":"iminside","description":"Event emitter for es6 classes","archived":false,"fork":false,"pushed_at":"2015-09-22T08:21:10.000Z","size":140,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-09T10:34:12.292Z","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/iminside.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-09-15T06:28:38.000Z","updated_at":"2025-01-13T21:13:52.000Z","dependencies_parsed_at":"2022-09-19T22:51:43.961Z","dependency_job_id":null,"html_url":"https://github.com/iminside/js.event_emitter","commit_stats":null,"previous_names":["4urbanoff/js.event_emitter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iminside%2Fjs.event_emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iminside%2Fjs.event_emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iminside%2Fjs.event_emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iminside%2Fjs.event_emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iminside","download_url":"https://codeload.github.com/iminside/js.event_emitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239242066,"owners_count":19605946,"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-06T17:43:19.904Z","updated_at":"2025-02-17T05:42:55.957Z","avatar_url":"https://github.com/iminside.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Install\n\n```\nnpm install js.event_emitter --save\n```\n\n### Usage\n\n```javascript\n\nimport EventEmitter from \"js.event_emitter\";\n\nclass Cat extends EventEmitter {}\n\nclass Dog extends EventEmitter {\n\n\tconstructor(){ \n\t\tthis.name = \"Bob\";\n\t}\n\n\tgav(){ \n\t\tconsole.log( this.name + \" gav\" ); \n\t}\n\n\tmanyGav(){ \n\t\tconsole.log( this.name + \" gav gav gav\" ); \n\t}\n\n}\n\n\nlet dog = new Dog,\n    cat = new Cat;\n  \ncat.on(                              // attach event handler, call on every trigger\n\t\"run\",                           // event name\n\tdog.gav,                         // event handler\n\tdog                              // callback context\n);\n\ncat.one( \"run\", dog.manyGav, dog );  // call on first trigger\n\ncat.trigger( \"run\" );                // \u003e \"Bob gav\"\n                                     // \u003e \"Bob gav gav gav\"\ncat.trigger( \"run\" );                // \u003e \"Bob gav\"\ncat.trigger( \"run\" );                // \u003e \"Bob gav\"\n\ncat.off();                           // detach all handlers of all events\ncat.off( \"run\" );                    // detach all handlers of \"run\" event\ncat.off( \"run\", dog.gav );           // detach dog.gav handler of \"run\" event\ncat.off( \"run\", dog.gav, dog );      // detach dog.gav handler of \"run\" event when context is dog\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiminside%2Fjs.event_emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiminside%2Fjs.event_emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiminside%2Fjs.event_emitter/lists"}