https://github.com/kevin-lyn/rxdratini
Dratini with RxSwift
https://github.com/kevin-lyn/rxdratini
ios macos network network-layer networking reactive reactive-programming rxswift
Last synced: about 1 month ago
JSON representation
Dratini with RxSwift
- Host: GitHub
- URL: https://github.com/kevin-lyn/rxdratini
- Owner: kevin-lyn
- License: mit
- Created: 2017-07-30T13:06:23.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-29T08:54:57.000Z (over 8 years ago)
- Last Synced: 2024-04-25T09:41:27.312Z (about 2 years ago)
- Topics: ios, macos, network, network-layer, networking, reactive, reactive-programming, rxswift
- Language: Swift
- Size: 30.3 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RxDratini  [](https://codecov.io/gh/kevin0571/RxDratini)    
RxDratini provides [RxSwift](https://github.com/ReactiveX/RxSwift/) extensions for [Dratini](https://github.com/kevin0571/Dratini).
## Requirements
- Xcode 8.0+
- Swift 3.0
## Usage
**CocoaPods**
```ruby
pod 'RxDratini'
```
**Carthage**
```ruby
github "kevin0571/RxDratini"
```
**Swift Package Manager**
```ruby
dependencies: [
.Package(url: "https://github.com/kevin0571/RxDratini.git", majorVersion: 1)
]
```
### Example
Subscribe for request:
```swift
// requestQueue, request and disposeBag are already initialized
request.asObservable(in: requestQueue).subscribe(onNext: { response in
// received response
}, onError: { error in
// received error
}).addDisposableTo(disposeBag)
```
Subscribe for response:
```swift
// requestQueue and disposeBag are already initialized
TestGetResponse.asObservable(in: requestQueue).subscribe(onNext: { response in
// received response
}, onError: { error in
// received error
}).addDisposableTo(disposeBag)
```
For usage of Dratini, please visit: https://github.com/kevin0571/Dratini