{"id":25191816,"url":"https://github.com/wvbe/simple-event","last_synced_at":"2026-02-19T18:02:10.165Z","repository":{"id":274773094,"uuid":"924023322","full_name":"wvbe/simple-event","owner":"wvbe","description":"A simple event class that I keep writing. One instance represents one event, and you can call it with typed parameters.","archived":false,"fork":false,"pushed_at":"2025-01-29T09:42:52.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-20T03:35:47.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/wvbe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-29T09:23:51.000Z","updated_at":"2025-01-29T09:42:55.000Z","dependencies_parsed_at":"2025-01-29T10:38:34.392Z","dependency_job_id":null,"html_url":"https://github.com/wvbe/simple-event","commit_stats":null,"previous_names":["wvbe/simple-event"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wvbe/simple-event","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvbe%2Fsimple-event","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvbe%2Fsimple-event/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvbe%2Fsimple-event/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvbe%2Fsimple-event/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wvbe","download_url":"https://codeload.github.com/wvbe/simple-event/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvbe%2Fsimple-event/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29626612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-02-09T22:36:49.211Z","updated_at":"2026-02-19T18:02:10.143Z","avatar_url":"https://github.com/wvbe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@wvbe/simple-event`\n\nA pure Javascript library for the world's simplest event. Works in the browser, NodeJS, Deno, etc.\nComes with types included.\n\n### Examples\n\nThe world's simplest example\"\n\n```ts\nconst e = new SimpleEvent();\nvoid e.on(() =\u003e {\n\tconsole.log('Something happened');\n});\nvoid e.emit();\n```\n\nCancel a specific listener:\n\n```ts\nconst destroyer = e.on(() =\u003e {\n\tconsole.log('Something happened');\n});\ndestroyer();\n```\n\nCancel all listeners:\n\n```ts\nconst destroyer = e.on(() =\u003e {\n\tconsole.log('Something happened');\n});\ne.clear();\n```\n\nWait for all event handlers to finish:\n\n```ts\nvoid e.on(async () =\u003e {\n\tawait fetch(CMS_URL, { method: 'post' });\n});\nawait e.emit();\n```\n\nType the parameters expected for emit(), and received by listener:\n\n```ts\nconst e = new SimpleEvent\u003c[UserObject, PermissionsObject]\u003e();\nvoid e.on((user, permissions) =\u003e {\n\t// `user` and `permissions` argument are typed as\n\t// `UserObject` and `PermissionsObject` respectively\n\tconsole.log(user.name, permissions);\n});\nvoid e.emit(currentUser, defaultPermissions);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwvbe%2Fsimple-event","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwvbe%2Fsimple-event","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwvbe%2Fsimple-event/lists"}