https://github.com/geektree0101/rxasdiff
Texture Reactive Diff Library built on DeepDiff
https://github.com/geektree0101/rxasdiff
Last synced: 9 months ago
JSON representation
Texture Reactive Diff Library built on DeepDiff
- Host: GitHub
- URL: https://github.com/geektree0101/rxasdiff
- Owner: GeekTree0101
- License: mit
- Created: 2018-06-02T18:49:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-03T05:56:08.000Z (almost 8 years ago)
- Last Synced: 2025-10-11T21:37:23.266Z (9 months ago)
- Language: Swift
- Homepage:
- Size: 62.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RxASDiff
[](https://travis-ci.org/Geektree0101/RxASDiff)
[](https://cocoapods.org/pods/RxASDiff)
[](https://cocoapods.org/pods/RxASDiff)
[](https://cocoapods.org/pods/RxASDiff)

**RxASDiff** is Texture Reactive Diff Library built on DeepDiff(ref: https://github.com/onmyway133/DeepDiff)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
### create diff output
```swift
let relay = BehaviorRelay<[HashableObject]>(value: [])
// Behavior or Publich or etc all Observer available
DiffObserver.rxDiff(relay.asObservable()).subscribe( ... ).disposed(by: ...)
// output: Array> ref: https://github.com/onmyway133/DeepDiff
```
### convert diff to indexPaths object
```swift
let relay = BehaviorRelay<[HashableObject]>(value: [])
// Behavior or Publich or etc all Observer available
DiffObserver.rxDiff(relay.asObservable(), section: Int).subscribe().disposed()
// output: ChangeWithIndexPath ref: https://github.com/onmyway133/DeepDiff
```
### convenience apply diff output onto tableNode or collectionNode
```swift
func case1() {
DiffObserver
.rxDiff(relay.asObservable(), section: 1)
.subscribe(onNext: { iter in
self.tableNode.applyDiff(iter, completion: nil)
}).disposed(by: bag)
}
func case2() {
let diffObserver = DiffObserver.rxDiff(relay.asObservable())
tableNode.rx
.applyDiff(diffObserver, section: 1, completion: nil)
.disposed(by: bag)
}
```
## Requirements
- Xcode <~ 9.3
- Swift <~ 4.1
- iOS <~ 9.3
## Installation
RxASDiff is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'RxASDiff'
```
## Author
Geektree0101, h2s1880@gmail.com
## License
RxASDiff is available under the MIT license. See the LICENSE file for more info.