{"id":30719840,"url":"https://github.com/dankinsoid/rxoperators","last_synced_at":"2025-09-03T10:42:24.940Z","repository":{"id":62453166,"uuid":"146027953","full_name":"dankinsoid/RxOperators","owner":"dankinsoid","description":"Convenient operators for RxSwift","archived":false,"fork":false,"pushed_at":"2022-10-04T14:05:36.000Z","size":174,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-06T21:52:04.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","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/dankinsoid.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-24T18:44:23.000Z","updated_at":"2023-01-06T19:35:37.000Z","dependencies_parsed_at":"2022-11-01T22:46:32.988Z","dependency_job_id":null,"html_url":"https://github.com/dankinsoid/RxOperators","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/dankinsoid/RxOperators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FRxOperators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FRxOperators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FRxOperators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FRxOperators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dankinsoid","download_url":"https://codeload.github.com/dankinsoid/RxOperators/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FRxOperators/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273431361,"owners_count":25104491,"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-09-03T02:00:09.631Z","response_time":76,"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":"2025-09-03T10:42:23.994Z","updated_at":"2025-09-03T10:42:24.920Z","avatar_url":"https://github.com/dankinsoid.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RxOperators\n[![CI Status](https://img.shields.io/travis/Voidilov/RxOperators.svg?style=flat)](https://travis-ci.org/Voidilov/RxOperators)\n[![Version](https://img.shields.io/cocoapods/v/RxOperators.svg?style=flat)](https://cocoapods.org/pods/RxOperators)\n[![License](https://img.shields.io/cocoapods/l/RxOperators.svg?style=flat)](https://cocoapods.org/pods/RxOperators)\n[![Platform](https://img.shields.io/cocoapods/p/RxOperators.svg?style=flat)](https://cocoapods.org/pods/RxOperators)\n\n## Description\n\nThis repo includes operators for RxSwift and some additional features.\n\nExample\n\n```swift\nimport UIKit\nimport RxSwift\nimport RxCocoa\nimport RxOperators\n\nfinal class SomeViewModel {\n  let title = ValueSubject(\"Title\")\n  let icon = ValueSubject\u003cUIImage?\u003e(nil)\n  let color = ValueSubject(UIColor.white)\n  let bool = ValueSubject(false)\n  ...\n} \n\nclass ViewController: UIViewController {\n\n  @IBOutlet private weak var titleLabel: UILabel!\n  @IBOutlet private weak var iconView: UIImageView!\n  @IBOutlet private weak var switchView: UISwitch!\n\n  let viewModel = SomeViewModel()\n  ...\n  private func configureSubscriptions() {\n    viewModel.title ==\u003e titleLabel.rx.text\n    viewModel.iconView ==\u003e iconView.rx.image\n    viewModel.bool \u003c==\u003e switchView.rx.isOn\n    viewModel.color ==\u003e (self, ViewController.setTint)\n    //or viewModel.color ==\u003e rx.weak(method: ViewController.setTint)\n    //or viewModel.color ==\u003e {[weak self] in self?.setTint(color: $0) }\n  }\n\n  private func setTint(color: UIColor) {\n  ...\n  } \n  ...\n}\n```\n\n## Usage\n\n1. Operator `=\u003e` \n\n  - From `ObservableType` to `ObserverType`, creates a subscription and returns `Disposable`:\n  \n  ```swift\n  let disposable = intObservable =\u003e intObserver\n  ```\n\n  - From `Disposable` to `DisposeBag`:\n  \n  ```swift\n  someDisposable =\u003e disposeBag\n  someObservable =\u003e someObserver =\u003e disposeBag\n  ```\n  \n  - From `ObservableType` to `SchedulerType`, returns `Observable\u003cE\u003e`:\n  \n  ```swift\n  let scheduler = SerialDispatchQueueScheduler(internalSerialQueueName: \"Scheduler\")\n  someObservable =\u003e scheduler =\u003e someObserver =\u003e disposeBag\n  ```\n  \n2. Operator `==\u003e`\n  \nDrive `ObservableType` to `ObserverType` on main queue and returns `Disposable`:\n```swift\nintObservable ==\u003e intObserver =\u003e disposeBag\n```\n\n3. Operators `\u003c=\u003e` and `\u003c==\u003e` create bidirectional subscriptions for `Equatable` sequences\n\n4. Operator `=\u003e\u003e` replaces `.distinctUntilChanged()`\n\n5. `DisposableObserverType` and `DisposableObservableType` - protocols for observer and observeables that dispose all subscriptions on deinit, so you don't have to control disposing for each subscription.\n\n6. `ValueSubject\u003cElement\u003e` - analog of `Variable\u003cElement\u003e` with `DisposeBag` inside.\n\n7. Some features:\n\n- `skipNil()` operator\n- `or(Bool), .toggle(), !` operators for boolean sequences\n- use `+` and `+=` operator for merging observables, creating disposables, etc\n- `interval(...)` \n- `withLast() -\u003e Observable\u003c(previous: Element?, current: Element)\u003e`\n- `rx.asDisposeBag`\n- `.mp` - `@dynamicMemberLookup` mapper\n- `asResult() -\u003e Observable\u003cResult\u003cElement, Error\u003e\u003e`\n- `nilIfEmpty`\n- `isEmpty`\n- `isNil`\n- `isNilOrEmpty`\n- `wrap(...), guarantee(...)` static methods on Single to create Single from functions with completions\n- `append(...)`\n- `smooth(...)` methods to smooth changes, example: sequence`[0, 1]` turns to `[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]`\n- `onNext, afterNext, onError, afterError, onCompleted, afterCompleted, onSubscribe, onSubscribed, onDispose` wrappers on `do(...)` operator\n- `guard()`\n- `rx.isFirstResponder`\n- `UIStackView().rx.update(...)`\n- `UIView().rx.transform.scale(), .rotation(), .translation()`\n\n## Installation\n\n1.  [CocoaPods](https://cocoapods.org)\n\nRxOperators is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n```ruby\npod 'RxOperators'\n```\nand run `pod update` from the podfile directory first.\n\n2. [Swift Package Manager](https://github.com/apple/swift-package-manager)\n\nCreate a `Package.swift` file.\n```swift\n// swift-tools-version:5.0\nimport PackageDescription\n\nlet package = Package(\n  name: \"SomeProject\",\n  dependencies: [\n    .package(url: \"https://github.com/dankinsoid/RxOperators.git\", from: \"2.11.0\")\n    ],\n  targets: [\n    .target(name: \"SomeProject\", dependencies: [\"RxOperators\"])\n    ]\n)\n```\n```ruby\n$ swift build\n```\n## Author\n\nVoidilov, voidilov@gmail.com\n\n## License\n\nRxOperators is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankinsoid%2Frxoperators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdankinsoid%2Frxoperators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankinsoid%2Frxoperators/lists"}