{"id":23333970,"url":"https://github.com/utsuboco/events","last_synced_at":"2025-04-09T18:50:33.349Z","repository":{"id":57389311,"uuid":"407081510","full_name":"utsuboco/events","owner":"utsuboco","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-24T02:59:42.000Z","size":86,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T21:34:33.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/utsubo-events-4q3mi","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/utsuboco.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":"2021-09-16T08:17:08.000Z","updated_at":"2024-09-29T02:46:25.000Z","dependencies_parsed_at":"2024-06-18T22:42:37.637Z","dependency_job_id":"eed026fa-d6a1-4910-bc60-0b4601739c68","html_url":"https://github.com/utsuboco/events","commit_stats":null,"previous_names":["utsuboco/utsubo-events"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utsuboco%2Fevents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utsuboco%2Fevents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utsuboco%2Fevents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utsuboco%2Fevents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utsuboco","download_url":"https://codeload.github.com/utsuboco/events/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248092197,"owners_count":21046431,"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-12-21T00:35:41.668Z","updated_at":"2025-04-09T18:50:33.323Z","avatar_url":"https://github.com/utsuboco.png","language":"TypeScript","readme":"# @utsubo/events\n\nMinimalist library to emit and receive custom events.\n\n```bash\nyarn add @utsubo/events\n```\n\n## Example\n\n```ts\nimport { onEvent, offEvent, emitEvent, useEvent } from '@utsubo/events'\n\n// Create an event listener\nconst handler = (e) =\u003e console.log('event', e)\nonEvent('event', handler, { once: false })\n\n// Dispatch a payload to event listeners\nemitEvent('event', 'event data')\n\n// Remove the event listener\noffEvent('event', handler, { once: false })\n\n// React hook bindings to create reactive handlers.\nfunction Component() {\n  useEvent('event', (e) =\u003e console.log('event', e), [key], { once: false })\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futsuboco%2Fevents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futsuboco%2Fevents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futsuboco%2Fevents/lists"}