{"id":21674460,"url":"https://github.com/neki-dev/make-event","last_synced_at":"2025-10-15T13:37:01.042Z","repository":{"id":264393106,"uuid":"893250862","full_name":"neki-dev/make-event","owner":"neki-dev","description":"🧩 Easy pattern to create events with subscriptions","archived":false,"fork":false,"pushed_at":"2025-06-14T11:35:47.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T00:05:41.552Z","etag":null,"topics":["emitter","event","events","listener","subscription"],"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/neki-dev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-23T23:27:48.000Z","updated_at":"2025-06-14T11:35:50.000Z","dependencies_parsed_at":"2025-05-08T22:30:43.175Z","dependency_job_id":"46f92343-ad53-4382-9910-70245713ea86","html_url":"https://github.com/neki-dev/make-event","commit_stats":null,"previous_names":["neki-dev/event-thread","neki-dev/event-train","neki-dev/make-event"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neki-dev/make-event","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neki-dev%2Fmake-event","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neki-dev%2Fmake-event/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neki-dev%2Fmake-event/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neki-dev%2Fmake-event/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neki-dev","download_url":"https://codeload.github.com/neki-dev/make-event/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neki-dev%2Fmake-event/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279083707,"owners_count":26099699,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["emitter","event","events","listener","subscription"],"created_at":"2024-11-25T13:47:37.706Z","updated_at":"2025-10-15T13:37:01.025Z","avatar_url":"https://github.com/neki-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🧩 Make event\n[![Version](https://badgen.net/npm/v/make-event)](https://npmjs.com/package/make-event)\n[![Size](https://img.badgesize.io/neki-dev/make-event/master/dist/index.js)](https://github.com/neki-dev/make-event/blob/master/dist/index.js)\n[![Test](https://github.com/neki-dev/make-event/actions/workflows/test.yml/badge.svg)](https://github.com/neki-dev/make-event/actions/workflows/test.yml)\n[![Build](https://github.com/neki-dev/make-event/actions/workflows/build.yml/badge.svg)](https://github.com/neki-dev/make-event/actions/workflows/build.yml)\n\nEasy pattern to create events with subscriptions\n\n.\n\n## Install\n\n```sh\nnpm i make-event\n```\n\n.\n\n## Usage\n  \n### Subscribe to event\n```ts\nconst onUpdate = Events.make\u003cnumber\u003e();\n\nonUpdate((value) =\u003e {\n  console.log(value);\n});\n```\n\n### Unsubcsribe from event\n```ts\nconst onUpdate = Events.make();\n\n// method 1\n\nconst unsubscribe = onUpdate(() =\u003e {\n});\n\nunsubscribe();\n\n// method 2\n\nconst handler = () =\u003e {\n  console.log(true);\n}\n\nonUpdate(handler);\n\nonUpdate.unsubscribe(handler);\n```\n\n### Invoke event\n```ts\nconst onUpdate = Events.make\u003cnumber\u003e();\n\nonUpdate.invoke(10);\n```\n\n### Remove all handlers\n```ts\nconst onUpdate = Events.make();\n\nonUpdate.clear();\n```\n\n.\n\n## Example\n```ts\nimport { Events } from 'make-event';\n\nclass Player {\n  public readonly onJump = Events.make\u003chumber\u003e();\n\n  public jump(height: number) {\n    this.onJump.invoke(height);\n  }\n}\n\n// ...\n\nconst player = new Player();\n\nplayer.onJump((height) =\u003e {\n  console.log('onJump1', height);\n});\n\nconst unsubscribe = player.onJump((height) =\u003e {\n  console.log('onJump2', height);\n});\n\nunsubscribe();\n\nplayer.jump(10);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneki-dev%2Fmake-event","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneki-dev%2Fmake-event","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneki-dev%2Fmake-event/lists"}