{"id":15383457,"url":"https://github.com/pimdewit/event-dispatcher","last_synced_at":"2025-03-27T22:42:48.362Z","repository":{"id":57135641,"uuid":"155975466","full_name":"pimdewit/event-dispatcher","owner":"pimdewit","description":"Performant, opinionated event dispatcher.","archived":false,"fork":false,"pushed_at":"2022-10-10T09:19:09.000Z","size":98,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T10:44:19.667Z","etag":null,"topics":["eventdispatcher","events","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/pimdewit.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":"2018-11-03T11:10:21.000Z","updated_at":"2022-03-06T14:03:03.000Z","dependencies_parsed_at":"2022-09-04T09:10:51.632Z","dependency_job_id":null,"html_url":"https://github.com/pimdewit/event-dispatcher","commit_stats":null,"previous_names":["pimdewit/eventdispatcher"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimdewit%2Fevent-dispatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimdewit%2Fevent-dispatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimdewit%2Fevent-dispatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimdewit%2Fevent-dispatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pimdewit","download_url":"https://codeload.github.com/pimdewit/event-dispatcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245937916,"owners_count":20696987,"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":["eventdispatcher","events","typescript"],"created_at":"2024-10-01T14:37:47.738Z","updated_at":"2025-03-27T22:42:48.340Z","avatar_url":"https://github.com/pimdewit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EventDispatcher\n\nPerformant, opinionated event dispatcher.\n\n## Installation\n\n`npm install @pdw.io/event-dispatcher`\n\n## Usage\n\nBelow is a very minimal example. The main thing to note is that the \"event names\" are strictly numbers (Enum keys in this case), this is where the performance comes from.\n\n```typescript\nimport { EventDispatcher } from '@pdw.io/eventdispatcher';\n\nexport enum DialogEventName {\n  OPEN,\n  CLOSE,\n}\n\nclass Dialog extends EventDispatcher\u003cDialogEventName\u003e {\n  private open = false;\n\n  toggle() {\n    this.open = !this.open;\n    const eventToSend = this.open ? DialogEventName.OPEN : DialogEventName.CLOSE;\n    this.dispatchEvent(eventToSend);\n  }\n}\n\nconst dialog = new Dialog();\ndialog.addEventListener(DialogEventName.OPEN, callback);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimdewit%2Fevent-dispatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpimdewit%2Fevent-dispatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimdewit%2Fevent-dispatcher/lists"}