{"id":1813,"url":"https://github.com/RxSwiftCommunity/NSObject-Rx","last_synced_at":"2025-08-02T04:32:37.658Z","repository":{"id":40625893,"uuid":"46182438","full_name":"RxSwiftCommunity/NSObject-Rx","owner":"RxSwiftCommunity","description":"Handy RxSwift extensions on NSObject, including rx.disposeBag.","archived":false,"fork":false,"pushed_at":"2022-09-26T05:56:32.000Z","size":1161,"stargazers_count":650,"open_issues_count":9,"forks_count":69,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-08-01T07:41:24.878Z","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/RxSwiftCommunity.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","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-11-14T16:37:48.000Z","updated_at":"2025-07-27T19:20:06.000Z","dependencies_parsed_at":"2022-07-11T02:51:19.624Z","dependency_job_id":null,"html_url":"https://github.com/RxSwiftCommunity/NSObject-Rx","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/RxSwiftCommunity/NSObject-Rx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FNSObject-Rx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FNSObject-Rx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FNSObject-Rx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FNSObject-Rx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RxSwiftCommunity","download_url":"https://codeload.github.com/RxSwiftCommunity/NSObject-Rx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FNSObject-Rx/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":[],"created_at":"2024-01-05T20:15:56.413Z","updated_at":"2025-08-02T04:32:37.383Z","avatar_url":"https://github.com/RxSwiftCommunity.png","language":"Swift","funding_links":[],"categories":["Reactive Programming","Libraries","OOM-Leaks-Crash"],"sub_categories":["Other free courses","Prototyping","Other Parsing","Rx Series"],"readme":"[![CircleCI](https://circleci.com/gh/RxSwiftCommunity/NSObject-Rx/tree/master.svg?style=svg)](https://circleci.com/gh/RxSwiftCommunity/NSObject-Rx/tree/master)\n\nNSObject+Rx\n===========\n\nIf you're using [RxSwift](https://github.com/ReactiveX/RxSwift), you've probably encountered the following code more than a few times.\n\n```swift\nclass MyObject: Whatever {\n\tlet disposeBag = DisposeBag()\n\n\t...\n}\n```\n\nYou're actually not the only one; it has been typed many, many times.\n\n[![Search screenshot showing many, many results.](assets/screenshot.png)](https://github.com/search?q=let+disposeBag+%3D+DisposeBag%28%29\u0026type=Code\u0026utf8=✓)\n\nInstead of adding a new property to every object, use this library to add it for you, to any subclass of `NSObject`.\n\n```swift\nthing\n  .bind(to: otherThing)\n  .disposed(by: rx.disposeBag)\n```\n\nSweet.\n\nIt'll work just like a property: when the instance is deinit'd, the `DisposeBag` gets disposed. It's also a read/write property, so you can use your own, too.\n\nIf you want to add a DisposeBag to an Object that does not inherit from NSObject, you can also implement the protocol `HasDisposeBag`, and you're good to go. This protocol provides a default DisposeBag called `disposeBag`.\n\nInstalling\n----------\n\n#### CocoaPods\n\nAdd to your `Podfile`:\n\n```ruby\npod 'NSObject+Rx'\n```\n\nAnd that'll be 👌\n\n#### Carthage\n\nAdd to `Cartfile`:\n```\ngithub \"RxSwiftCommunity/NSObject-Rx\"\n```\nAdd frameworks to your project (no need to \"copy items if needed\")\n\nRun `carthage update` or `carthage update --platform ios` if you target iOS only\n\nAdd run script build phase `/usr/local/bin/carthage copy-frameworks`\nwith input files being:\n\n```\n$(SRCROOT)/Carthage/Build/iOS/RxSwift.framework\n$(SRCROOT)/Carthage/Build/iOS/NSObject_Rx.framework\n```\n\nAnd rule ✌️\n\nContributing\n------------\n\nSource files are in the root directory. We use CocoaPods to develop, check out the unit tests in the Demo project.\n\nLicense\n-------\n\nMIT obvs.\n\n![Tim Cook dancing to the sound of a permissive license.](http://i.imgur.com/mONiWzj.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FNSObject-Rx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRxSwiftCommunity%2FNSObject-Rx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FNSObject-Rx/lists"}