{"id":13536830,"url":"https://github.com/noheltcj/RxCommon","last_synced_at":"2025-04-02T03:31:11.605Z","repository":{"id":57726833,"uuid":"145054223","full_name":"noheltcj/RxCommon","owner":"noheltcj","description":"Multiplatform implementation of ReactiveX providing a common way to build one set of business logic for native, iOS, Javascript, Android, JVM, and other platforms.","archived":false,"fork":false,"pushed_at":"2019-12-08T01:37:25.000Z","size":193,"stargazers_count":82,"open_issues_count":5,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-27T17:04:52.318Z","etag":null,"topics":["kotlin","kotlin-multiplatform","kotlin-native","reactivex","rx"],"latest_commit_sha":null,"homepage":"","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/noheltcj.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":"2018-08-17T00:54:44.000Z","updated_at":"2023-05-20T18:22:52.000Z","dependencies_parsed_at":"2022-09-26T21:51:02.878Z","dependency_job_id":null,"html_url":"https://github.com/noheltcj/RxCommon","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noheltcj%2FRxCommon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noheltcj%2FRxCommon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noheltcj%2FRxCommon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noheltcj%2FRxCommon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noheltcj","download_url":"https://codeload.github.com/noheltcj/RxCommon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246751082,"owners_count":20827833,"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":["kotlin","kotlin-multiplatform","kotlin-native","reactivex","rx"],"created_at":"2024-08-01T09:00:50.175Z","updated_at":"2025-04-02T03:31:10.922Z","avatar_url":"https://github.com/noheltcj.png","language":"Kotlin","funding_links":[],"categories":["Libraries"],"sub_categories":["Reactive"],"readme":"# RxCommon\nA multi-platform ReactiveX implementation targetting JVM, iOS, Android, and JS.\n\nMore targets can be added upon request.\n\n## Documentation\nPlease refer to \u003chttps://reactivex.io\u003e for documentation.\n\n### Sources\nThe reactivex documentation covers much of the functionality. If there are any significant discrepancies,\nexcluding those illuminated within this documentation, please post an issue.\n\n* [Observable](\u003chttp://reactivex.io/documentation/observable.html\u003e)\n* Single - Similar to observable, but will complete when the first value is emitted.\n* BehaviorRelay - [Subject](http://reactivex.io/documentation/subject.html) which ignores all notifications. Relays \nretain and emit the latest element.\n* [BehaviorSubject](http://reactivex.io/documentation/subject.html) - Similar to the BehaviorRelay, but acknowledges\nnotifications\n* [PublishSubject](http://reactivex.io/documentation/subject.html)\n* More coming, _new collaborators / contributions are greatly appreciated_.\n\n### Operators\nMore operators are coming quickly, but not all have been implemented.\n\nCurrently supported operators:\n* [map](http://reactivex.io/documentation/operators/map.html)\n* [filter](http://reactivex.io/documentation/operators/filter.html)\n* [flatMap](http://reactivex.io/documentation/operators/flatmap.html)\n* switchMap (non-interleaving variant of [FlatMap](http://reactivex.io/documentation/operators/flatmap.html))\n* [combineLatest](http://reactivex.io/documentation/operators/combinelatest.html)\n* [onErrorReturn](http://reactivex.io/documentation/operators/catch.html)\n* [toSingle](http://reactivex.io/documentation/operators/first.html)\n* [first](http://reactivex.io/documentation/operators/first.html)\n\n### Examples\n```kotlin\nSingle(just = \"hello\")\n  .map { \"$it world\" }\n  .subscribe(NextObserver { result -\u003e\n    // result =\u003e \"hello world\"\n  })\n\n/* Be sure to dispose when this is no longer needed to prevent leaks. */\nval disposable = Observable\u003cString\u003e(createWithEmitter = { emitter -\u003e\n  emitter.next(\"we're happy\")\n  emitter.next(\"la la la\")\n\n  Disposables.create {\n    /*\n     * This block is called when this cold observable loses all of its observers or\n     * a notification is received. Use this to clean up any open connections, etc.\n     */\n  }\n}).flatMap { happyText -\u003e\n  /* Use the text to maybe fetch something from an api. */\n  return@flatMap Single\u003cString\u003e(error = UnauthorizedException()) // Uh oh, expired access\n    .onErrorReturn { throwable -\u003e\n      /* Handle throwable, maybe check for unauthorized and recover */\n      return@onErrorReturn Single(just = \"$happyText recovery\")\n    }\n}.subscribe(NextTerminalObserver({ emission -\u003e\n  /*\n   * emission =\u003e \"we're happy recovery\"\n   * emission =\u003e \"la la la recovery\"\n   */\n}, { throwable -\u003e\n  /* No terminal notifications in this example */\n}))\n```\n\n## Installing\n\nPlease ensure you're using gradle 5.3+.\n\nInstalling has recently become significantly easier. Now it's as simple as including\nthe following:\n\n### Kotlin Build Script\n\n```kotlin \nkotlin {\n    sourceSets {\n        val commonMain by getting {\n            dependencies {\n                api(\"com.noheltcj:rxcommon:0.6.1\")\n            }\n        }\n    }\n}\n```\n\n### Groovy Build Script\n\n```kotlin \nkotlin {\n    sourceSets {\n        commonMain {\n            dependencies {\n                api 'com.noheltcj:rxcommon:0.6.1'\n            }\n        }\n    }\n}\n```\n\n### Kotlin Support Map (For Native)\n\nSince native modules require dependencies to be compiled with the same kotlin version,\nwe will be keeping up with this support map going forward.\n\n```\n0.4.2 -\u003e 1.3.20\n0.5.0 -\u003e 1.3.21\n0.5.1 -\u003e 1.3.21\n0.5.2 -\u003e 1.3.30\n0.5.3 -\u003e 1.3.31\n0.6.0 -\u003e 1.3.50\n0.6.1 -\u003e 1.3.61\n```\n\n### Objective-C Generics\nObjective-c only has partial generics support, so we lose a bit of \ninformation when this library is imported as a framework in XCode.\n\nTo help with this, when you produce an Objective-C framework, be sure to\nenable generics support.\n\n```^groovy\ncomponents.main {\n    outputKinds(\"framework\")\n    extraOpts \"-Xobjc-generics\"\n}\n```\n\n### Concurrency\nThis library doesn't support concurrency. In the majority of cases, concurrency is\na side effect that can be handled on the platform. If you are doing anything that\nrequires a significant amount of time to operate, it's important to do this work\noff the main thread (Especially if your application has a user interface). Of course\ndo that using other resources such as RxSwift, RxJava, or basic platform concurrency\nframeworks, but ensure you've returned to the main thread before re-entering the common code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoheltcj%2FRxCommon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoheltcj%2FRxCommon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoheltcj%2FRxCommon/lists"}