{"id":22143436,"url":"https://github.com/hc-oss/react-gbus","last_synced_at":"2026-05-08T18:33:09.927Z","repository":{"id":47932590,"uuid":"226061609","full_name":"hc-oss/react-gbus","owner":"hc-oss","description":"global event bus hook for react (pub/sub)","archived":false,"fork":false,"pushed_at":"2023-07-11T01:57:01.000Z","size":302,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-15T06:11:49.914Z","etag":null,"topics":["broadcast","emit","eventemitter","events","pubsub","react","subscribe"],"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/hc-oss.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}},"created_at":"2019-12-05T09:13:25.000Z","updated_at":"2022-10-07T07:22:43.000Z","dependencies_parsed_at":"2024-01-06T13:09:34.746Z","dependency_job_id":"34e73455-2110-45d3-aacd-3480c924249b","html_url":"https://github.com/hc-oss/react-gbus","commit_stats":{"total_commits":112,"total_committers":4,"mean_commits":28.0,"dds":0.0535714285714286,"last_synced_commit":"e681d35a84bd9a6d336e14eb10425f32cc5adb13"},"previous_names":["harshzalavadiya/react-gbus"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/hc-oss/react-gbus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hc-oss%2Freact-gbus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hc-oss%2Freact-gbus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hc-oss%2Freact-gbus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hc-oss%2Freact-gbus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hc-oss","download_url":"https://codeload.github.com/hc-oss/react-gbus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hc-oss%2Freact-gbus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32792136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"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":["broadcast","emit","eventemitter","events","pubsub","react","subscribe"],"created_at":"2024-12-01T22:10:54.283Z","updated_at":"2026-05-08T18:33:09.897Z","avatar_url":"https://github.com/hc-oss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react global event bus\n\nGlobal event bus hook for react\n\n![GitHub Actions Status](https://github.com/harshzalavadiya/react-gbus/workflows/NodeJS/badge.svg)\n![NPM](https://img.shields.io/npm/v/react-gbus.svg)\n![gzip](https://badgen.net/bundlephobia/minzip/react-gbus)\n\n## 🔧 Installation\n\n```bash\nnpm install --save react-gbus\n```\n\n## ✨ Features\n\n- 📢 Broadcast(emit) from anywhere (not limited to react components)\n- 🍃 Ultra lightweight less then 1KB\n- ✌ Written w/ TypeScript\n\n## 📦 Usage\n\n```tsx\nimport React, { useState } from \"react\";\n\nimport BusProvider, { useListener, emit } from \"react-gbus\";\n\nconst FRUIT_CHANGE = \"fch\";\n\nfunction FruitViewer() {\n  const [Fruit, setFruit] = useState(\"Choose your Fruit\");\n\n  useListener(setFruit, [FRUIT_CHANGE]);\n\n  return \u003ch1\u003e{Fruit}\u003c/h1\u003e;\n}\n\nconst FruitChooser = () =\u003e (\n  \u003cdiv\u003e\n    \u003cbutton onClick={() =\u003e emit(FRUIT_CHANGE, \"🍎\")}\u003eApple\u003c/button\u003e\n    \u003cbutton onClick={() =\u003e emit(FRUIT_CHANGE, \"🥭\")}\u003eMango\u003c/button\u003e\n    \u003cbutton onClick={() =\u003e emit(FRUIT_CHANGE, \"🍍\")}\u003ePineapple\u003c/button\u003e\n  \u003c/div\u003e\n);\n\nconst App = () =\u003e (\n  \u003cBusProvider\u003e\n    \u003cFruitViewer /\u003e\n    \u003cFruitChooser /\u003e\n  \u003c/BusProvider\u003e\n);\n```\n\n## License\n\nMIT © [harshzalavadiya](https://github.com/harshzalavadiya)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhc-oss%2Freact-gbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhc-oss%2Freact-gbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhc-oss%2Freact-gbus/lists"}