{"id":1838,"url":"https://github.com/Daltron/RxAlamoRecord","last_synced_at":"2025-08-02T04:32:41.993Z","repository":{"id":62453073,"uuid":"144291837","full_name":"Daltron/RxAlamoRecord","owner":"Daltron","description":"RxAlamoRecord combines the power of the AlamoRecord and RxSwift libraries to create a networking layer that makes interacting with API's easier than ever reactively.","archived":false,"fork":false,"pushed_at":"2020-08-07T02:53:25.000Z","size":1631,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-14T10:28:13.623Z","etag":null,"topics":["activerecord","alamofire","api","ios","json","networking","reactive-programming","rxswift"],"latest_commit_sha":null,"homepage":null,"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/Daltron.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},"funding":{"github":["daltron"]}},"created_at":"2018-08-10T13:49:16.000Z","updated_at":"2020-08-07T02:53:23.000Z","dependencies_parsed_at":"2022-11-01T23:45:55.618Z","dependency_job_id":null,"html_url":"https://github.com/Daltron/RxAlamoRecord","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Daltron/RxAlamoRecord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daltron%2FRxAlamoRecord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daltron%2FRxAlamoRecord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daltron%2FRxAlamoRecord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daltron%2FRxAlamoRecord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daltron","download_url":"https://codeload.github.com/Daltron/RxAlamoRecord/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daltron%2FRxAlamoRecord/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334618,"owners_count":24233793,"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-08-02T02:00:12.353Z","response_time":74,"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":["activerecord","alamofire","api","ios","json","networking","reactive-programming","rxswift"],"created_at":"2024-01-05T20:15:56.997Z","updated_at":"2025-08-02T04:32:41.461Z","avatar_url":"https://github.com/Daltron.png","language":"Swift","funding_links":["https://github.com/sponsors/daltron"],"categories":["Reactive Programming"],"sub_categories":["Prototyping","Other Parsing"],"readme":"![RxAlamoRecord](https://github.com/Daltron/RxAlamoRecord/blob/master/RxAlamoRecord/Assets/rx_alamorecord.png?raw=true)\n\n[![Version](https://img.shields.io/cocoapods/v/RxAlamoRecord.svg?style=flat)](http://cocoapods.org/pods/RxAlamoRecord)\n\u003ca href=\"https://developer.apple.com/swift\"\u003e\u003cimg src=\"https://img.shields.io/badge/swift-5.1-4BC51D.svg?style=flat\" alt=\"Language: Swift\" /\u003e\u003c/a\u003e\n[![Platform](https://img.shields.io/cocoapods/p/RxAlamoRecord.svg?style=flat)](http://cocoapods.org/pods/RxAlamoRecord)\n[![License](https://img.shields.io/cocoapods/l/RxAlamoRecord.svg?style=flat)](http://cocoapods.org/pods/RxAlamoRecord)\n\n## Written in Swift 5\n\nRxAlamoRecord combines the power of the [AlamoRecord](https://github.com/tunespeak/AlamoRecord) and [RxSwift](https://github.com/ReactiveX/RxSwift) libraries to create a networking layer that makes interacting with API's easier than ever reactively.\n\n\n## Requirements\n\n- iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+\n- Xcode 10.2+\n- Swift 5.1\n\n## Installation\n\nRxAlamoRecord is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'RxAlamoRecord'\n```\n\n## Getting Started\n\nRxAlamoRecord can not be used without first understanding the basic principles of [AlamoRecord](https://github.com/tunespeak/AlamoRecord) and [RxSwift](https://github.com/ReactiveX/RxSwift). It is suggested you have a basic understanding of how both libraries work before proceeding.\n\n#### Purpose\n\nRxAlamoRecord gives you the power to bind your API reponses directly to `AlamoRecordRelay` and `Action` objects. [Action](https://github.com/RxSwiftCommunity/Action) is a powerful extension library created by the [RxSwiftCommunity](https://github.com/RxSwiftCommunity)\n\n#### `AlamoRecordRelay`\n\nThis object behaves exactly the same as a [BehaviorRelay](https://github.com/ReactiveX/RxSwift/blob/4431b623751ac5525e8a8c2d6e82f29b983af07c/RxCocoa/Traits/BehaviorRelay.swift) except that an `AlamoRecordRelay` can emit an error. It is required to use an instance of an `AlamoRecordRelay` when binding via RxAlamoRecord or else your app will crash if the API request returns an error or fails.\n\n##### To help simplify the examples, assume these variables are included in each one:\n\n```swift\nlet posts = AlamoRecordRelay\u003c[Post]\u003e(value: [])\nlet post = AlamoRecordRelay\u003cPost?\u003e(value: nil)\n\nlazy var failureAction: Action\u003cApplicationError, Swift.Never\u003e = {\n    return Action { [weak self] error in\n        // Do something with the error\n        return Observable.empty()\n    }\n}()\n\n```\n\n### Getting all instances of `Post` \n\n`GET` [https://jsonplaceholder.typicode.com/posts](https://jsonplaceholder.typicode.com/posts)\n\n```swift\nPost.rx\n    .all() \n    .execute()\n    .bind(to: posts, failure: failureAction)\n    .disposed(by: disposeBag)\n```\n\n### Creating an instance of `Post`\n\n`POST` [https://jsonplaceholder.typicode.com/posts](https://jsonplaceholder.typicode.com/posts)\n\n```swift\nPost.rx\n    .create()\n    .withParameters([\"userId\": userId, \"title\": title, \"body\": body]) \n    .execute()\n    .bind(to: post, failure: failureAction)\n    .disposed(by: disposeBag)\n```\n\n### Finding an instance of `Post`\n\n`GET` [https://jsonplaceholder.typicode.com/posts/1](https://jsonplaceholder.typicode.com/posts/1)\n\n```swift\nPost.rx\n    .find(id: 1)\n    .execute()\n    .bind(to: post, failure: failureAction)\n    .disposed(by: disposeBag)\n```\n\n### Updating an instance of `Post`\n\n`PUT` [https://jsonplaceholder.typicode.com/posts/1](https://jsonplaceholder.typicode.com/posts/1)\n\n```swift\npost.value?\n    .rx\n    .update()\n    .withParameters([\"userId\": userId, \"title\": title, \"body\": body])\n    .execute()\n    .bind(to: post, failure: failureAction)\n    .disposed(by: disposeBag)\n```\nThis can also be done at the class level:\n\n```swift\nPost.rx\n    .update(id: 1)\n    .withParameters([\"userId\": userId, \"title\": title, \"body\": body])\n    .execute()\n    .bind(to: post, failure: failureAction)\n    .disposed(by: disposeBag)\n```\n\n### Destroying an instance of `Post`\n\n`DELETE` [https://jsonplaceholder.typicode.com/posts/1](https://jsonplaceholder.typicode.com/posts/1)\n\n```swift\n\nlazy var destroyedAction: Action\u003cVoid, Swift.Never\u003e = {\n    return Action { [weak self] in\n        // The post is now destroyed\n\treturn Observable.empty()\n    }\n}()\n\npost.value?\n    .rx\t\n    .destroy()\n    .execute()\n    .bind(to: destroyedAction, failure: failureAction)\n    .disposed(by: disposeBag)\n```\nThis can also be done at the class level:\n\n```swift\nPost.rx\n    .destroy(id: 1)\n    .execute()\n    .bind(to: destroyedAction, failure: failureAction)\n    .disposed(by: disposeBag)\n```\n\n### Assigning default value on failure\n\nIt is also possible to assign a default value to an AlamoRecordRelay/Action object if an API request fails:\n\n```swift\nlet postTitle = AlamoRecordRelay\u003cString?\u003e(value: nil)\n\nPost.rx\n    .find(id: 1)\n    .execute()\n    .map { $0.title }\n    .bind(to: postTitle, valueOnFailure: \"Default Title\")\n    .disposed(by: disposeBag)\n```\n\n```swift\nlazy var postTitleAction: Action\u003cString, Swift.Never\u003e = {\n    return Action { [weak self] title in\n        // Do something with the title\n        return Observable.empty()\n    }\n}()\n\nPost.rx\n    .find(id: 1)\n    .execute()\n    .map { $0.title }\n    .bind(to: postTitleAction, valueOnFailure: \"Default Title\")\n    .disposed(by: disposeBag)\n```\n\n#### Download the example project to see just how easy creating an application with a reactive networking layer is when using RxAlamoRecord!\n\n## Author\n\nDalton Hinterscher, daltonhint4@gmail.com\n\n## Credits\n\nReactive Logo used in header image designed by [ReactiveX](https://github.com/ReactiveX) group\n\n## License\n\nRxAlamoRecord 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%2FDaltron%2FRxAlamoRecord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDaltron%2FRxAlamoRecord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDaltron%2FRxAlamoRecord/lists"}