{"id":16167967,"url":"https://github.com/kylecorry31/eventbusjs","last_synced_at":"2025-06-30T19:04:26.568Z","repository":{"id":80503801,"uuid":"130566236","full_name":"kylecorry31/EventBusJS","owner":"kylecorry31","description":null,"archived":false,"fork":false,"pushed_at":"2018-04-22T22:59:25.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-30T19:04:23.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/kylecorry31.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}},"created_at":"2018-04-22T12:41:51.000Z","updated_at":"2018-04-22T22:59:27.000Z","dependencies_parsed_at":"2023-03-02T10:00:57.107Z","dependency_job_id":null,"html_url":"https://github.com/kylecorry31/EventBusJS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kylecorry31/EventBusJS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylecorry31%2FEventBusJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylecorry31%2FEventBusJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylecorry31%2FEventBusJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylecorry31%2FEventBusJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylecorry31","download_url":"https://codeload.github.com/kylecorry31/EventBusJS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylecorry31%2FEventBusJS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262834788,"owners_count":23371849,"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-10-10T03:09:56.896Z","updated_at":"2025-06-30T19:04:26.520Z","avatar_url":"https://github.com/kylecorry31.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Event Bus JS\n\nA simple event bus framework for JavaScript.\n\n\n## Installation\nJust add the event_bus.js file to your project and include it with:\n\n```html\n\u003cscript src=\"event_bus.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\nThe Event Bus framework only provides three methods to subscribe, publish, or unsubscribe from events.\n\n### Subscribe\n```javascript\nEventBus.subscribe(\"testEvent\", function(data){\n  // Do something with data\n  console.log(data);\n});\n```\n\n### Publish\n```javascript\nEventBus.publish(\"testEvent\", 3);\n```\n\n### Unsubscribe\n```javascript\nEventBus.unsubscribe(\"testEvent\", function(data){});\n```\n\n### Example\n```javascript\nvar square = function(number){\n  console.log(number * number);\n};\n\nEventBus.subscribe(\"numbers\", console.log);\nEventBus.subscribe(\"numbers\", square);\n\nEventBus.publish(\"numbers\", 1);\nEventBus.publish(\"numbers\", 2);\n\nEventBus.unsubscribe(\"numbers\", square);\n\nEventBus.publish(\"numbers\", 3);\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylecorry31%2Feventbusjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylecorry31%2Feventbusjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylecorry31%2Feventbusjs/lists"}