{"id":19373182,"url":"https://github.com/adrielcafe/kbus","last_synced_at":"2025-10-11T06:02:35.267Z","repository":{"id":149190527,"uuid":"114942384","full_name":"adrielcafe/KBus","owner":"adrielcafe","description":"Dead simple EventBus for Android made with Kotlin and RxJava 2","archived":false,"fork":false,"pushed_at":"2020-01-25T12:03:02.000Z","size":132,"stargazers_count":46,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-31T20:35:14.952Z","etag":null,"topics":["android","android-library","eventbus","kotlin","kotlin-android","kotlin-library","rxjava","rxjava-android","rxjava2"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/adrielcafe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"ko_fi":"adrielcafe"}},"created_at":"2017-12-21T00:01:10.000Z","updated_at":"2023-08-23T18:32:11.000Z","dependencies_parsed_at":"2023-07-19T12:33:53.611Z","dependency_job_id":null,"html_url":"https://github.com/adrielcafe/KBus","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/adrielcafe/KBus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrielcafe%2FKBus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrielcafe%2FKBus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrielcafe%2FKBus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrielcafe%2FKBus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrielcafe","download_url":"https://codeload.github.com/adrielcafe/KBus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrielcafe%2FKBus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006355,"owners_count":26084088,"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-11T02:00:06.511Z","response_time":55,"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":["android","android-library","eventbus","kotlin","kotlin-android","kotlin-library","rxjava","rxjava-android","rxjava2"],"created_at":"2024-11-10T08:27:07.021Z","updated_at":"2025-10-11T06:02:35.252Z","avatar_url":"https://github.com/adrielcafe.png","language":"Kotlin","readme":"[![Release](https://jitpack.io/v/adrielcafe/KBus.svg)](https://jitpack.io/#adrielcafe/KBus) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-KBus-green.svg?style=flat)]( https://android-arsenal.com/details/1/6583)\n\n# KBus\nSuper lightweight (13 LOC) and minimalistic (`post()`, `subscribe()`, `unsubscribe()`) EventBus written with idiomatic Kotlin and RxJava 2\n\n## KBus in 3 steps\n\n### 1. Define your events\n```kotlin\n// With data\ndata class ShowMessageEvent(val message: String)\n\n// Without data\nclass OtherEvent\n```\n\n### 2. Add subscribers\n```kotlin\noverride fun onStart() {\n    super.onStart()\n    KBus.subscribe\u003cShowMessageEvent\u003e(this) {\n        showMessage(it.message)\n    }\n    KBus.subscribe\u003cOtherEvent\u003e(this) {\n        doSomething()\n    }\n}\n\noverride fun onStop() {\n    super.onStop()\n    KBus.unsubscribe(this)\n}\n```\n\nWhere:\n* **ShowMessageEvent** - the event you're subscribing\n* **this** - the subscriber (by default the current Activity/Fragment)\n* **{ showMessage() }** - the subscription observer\n* **it** - the event instance\n\n#### Sticky events\nIf you want to post events between Activities/Fragments just subscribe in `onCreate()` (or `onPostCreate()`) and unsubscribe in `onDestroy()`\n```kotlin\noverride fun onPostCreate(savedInstanceState: Bundle?) {\n    super.onPostCreate(savedInstanceState)\n    KBus.subscribe\u003cShowMessageEvent\u003e(this) {\n        showMessage(it.message)\n    }\n}\n\noverride fun onDestroy() {\n    super.onDestroy()\n    KBus.unsubscribe(this)\n}\n```\n\n### 3. Post events\n```kotlin\nKBus.post(ShowMessageEvent(\"Hello KBus!\"))\n```\n\n## Add KBus to your project\n```gradle\nrepositories {\n    maven { url \"https://jitpack.io\" }\n}\n\ndependencies {\n    implementation 'io.reactivex.rxjava2:rxjava:2.2.10'\n    implementation 'com.github.adrielcafe:KBus:1.1'\n}\n```","funding_links":["https://ko-fi.com/adrielcafe"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrielcafe%2Fkbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrielcafe%2Fkbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrielcafe%2Fkbus/lists"}