{"id":4457,"url":"https://github.com/paramaggarwal/react-native-global-event-emitter","last_synced_at":"2025-07-30T02:08:53.443Z","repository":{"id":57130565,"uuid":"41491880","full_name":"paramaggarwal/react-native-global-event-emitter","owner":"paramaggarwal","description":"Shared event emitter between native and JS for React Native.","archived":false,"fork":false,"pushed_at":"2016-01-25T06:56:51.000Z","size":107,"stargazers_count":58,"open_issues_count":1,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-23T08:58:27.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/paramaggarwal.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}},"created_at":"2015-08-27T14:34:41.000Z","updated_at":"2024-06-17T13:17:36.000Z","dependencies_parsed_at":"2022-08-31T18:22:23.099Z","dependency_job_id":null,"html_url":"https://github.com/paramaggarwal/react-native-global-event-emitter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/paramaggarwal/react-native-global-event-emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramaggarwal%2Freact-native-global-event-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramaggarwal%2Freact-native-global-event-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramaggarwal%2Freact-native-global-event-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramaggarwal%2Freact-native-global-event-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paramaggarwal","download_url":"https://codeload.github.com/paramaggarwal/react-native-global-event-emitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramaggarwal%2Freact-native-global-event-emitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267797539,"owners_count":24145705,"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-07-30T02:00:09.044Z","response_time":70,"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":[],"created_at":"2024-01-05T20:17:13.173Z","updated_at":"2025-07-30T02:08:53.365Z","avatar_url":"https://github.com/paramaggarwal.png","language":"Objective-C","funding_links":[],"categories":["Components"],"sub_categories":["Utils \u0026 Infra"],"readme":"# react-native-global-event-emitter\nShared event emitter between native and JS for React Native.\n\nUses iOS `NotificationCenter` and RN `DeviceEventEmitter` to provide a seamless global event bus between native and React Native.\n\n## Screenshot\n\n![Screenshot of the example app](https://github.com/paramaggarwal/react-native-global-event-emitter/raw/master/Screenshot.png)\n\n## Usage\n\n```javascript\n\n// listen to event posted to NSNotificationCenter by native code\nvar eventName = GlobalEventEmitter.UIApplicationNotifications.UIApplicationDidEnterBackgroundNotification;\nGlobalEventEmitter.addListener(eventName, (data) =\u003e {\n    console.log('UIApplicationDidEnterBackgroundNotification');\n});\n\n// event available on NSNotificationCenter for native code\nvar eventName = \"UserDidLoginFromJS\"\nGlobalEventEmitter.emit(eventName, {name: 'John'});\n\n```\n\n## Properties\n\n* `addListener`: Add a listener for an `eventName` and pass a `callback` function.\n* `emit`: Emit events to native/JS globally.\n* `removeListener`: Remove a listener by passing the `eventName` and the reference to the original `callback` function.\n* `removeAllListeners`: Stop listening to all events of a particular `eventName`.\n\n## Installation\n\nUse your preferred method of including the library in your app. \n\n## Example\nTry the included example:\n\n```sh\ngit clone git@github.com:paramaggarwal/react-native-global-event-emitter.git\nnpm install\nopen iOS/RNTGlobalEventEmitter.xcodeproj\n```\n\nThen `Cmd+R` to start the React Packager, build and run the project in the simulator.\n\n## Author\nParam Aggarwal (paramaggarwal@gmail.com)\n\n## License\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamaggarwal%2Freact-native-global-event-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparamaggarwal%2Freact-native-global-event-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamaggarwal%2Freact-native-global-event-emitter/lists"}