{"id":20461408,"url":"https://github.com/antvis/event-emitter","last_synced_at":"2025-04-13T06:17:15.533Z","repository":{"id":35023341,"uuid":"197686438","full_name":"antvis/event-emitter","owner":"antvis","description":"Simple event emitter for @antvis","archived":false,"fork":false,"pushed_at":"2022-02-10T09:43:00.000Z","size":14,"stargazers_count":20,"open_issues_count":0,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T06:17:11.257Z","etag":null,"topics":["ee","event-emitter"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/antvis.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":"2019-07-19T02:17:31.000Z","updated_at":"2024-11-06T03:03:05.000Z","dependencies_parsed_at":"2022-08-08T04:00:38.478Z","dependency_job_id":null,"html_url":"https://github.com/antvis/event-emitter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fevent-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fevent-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fevent-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fevent-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antvis","download_url":"https://codeload.github.com/antvis/event-emitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670437,"owners_count":21142905,"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":["ee","event-emitter"],"created_at":"2024-11-15T12:25:21.170Z","updated_at":"2025-04-13T06:17:15.496Z","avatar_url":"https://github.com/antvis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @antv/event-emitter\n\n\u003e event-emitter for @antvis.\n\n\n\n## Install\n\n\u003e npm i --save @antv/event-emitter\n\n\n\n## Usage\n\n```js\nimport EE from '@antv/event-emitter';\n\nconst ee = new EE();\n\nee.on('mouseover', () =\u003e {});\n\nee.once('click', () =\u003e {});\n\nee.on('*', () =\u003e {});\n\nee.emit('click', 1, 'hello', true);\n\nee.off('click');\n```\n\n\n\n## API\n\nSimple and similar with `event-emitter`.\n\n\n - `on(evt: string, callback: Function)`: listen an event.\n - `once(evt: string, callback: Function)`: listen a event only once.\n - `emit(evt: string, ...parameters: any[])`: emit / trigger an event with parameters.\n - `off(evt?: string, callback?: Function)`: unsubscribe an event.\n - `getEvents()`: get all the exist events.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fevent-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantvis%2Fevent-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fevent-emitter/lists"}