Krunoslav Zaher

11pods

Differentiator

Diff algorithm for UITableView and UICollectionView. RxDataSources is powered by Differentiator.

License: MIT

  • Swift

RxAlamofire

RxSwift wrapper around the elegant HTTP networking in Swift Alamofire

License: MIT

  • Swift

RxBlocking

Set of blocking operators for RxSwift. These operators are mostly intended for unit/integration tests with a couple of other special scenarios where they could be useful.

E.g.

Waiting for observable sequence to complete before exiting command line application.

License: NOASSERTION

  • Swift

RxCocoa

  • UI extensions
  • NSURL extensions
  • KVO extensions

License: NOASSERTION

  • Swift

RxDataSources

This is a collection of reactive data sources for UITableView and UICollectionView.

It enables creation of animated data sources for table an collection views in just a couple of lines of code.

```swift let data: Observable = ...

let dataSource = RxTableViewSectionedAnimatedDataSource() dataSource.cellFactory = { (tv, ip, i) in let cell = tv.dequeueReusableCell(withIdentifier: "Cell") ?? UITableViewCell(style:.Default, reuseIdentifier: "Cell") cell.textLabel!.text = "(i)" return cell }

// animated data .bind(to: animatedTableView.rx.items(dataSource: dataSource)) .disposed(by: disposeBag)

// normal reload data .bind(to: tableView.rx.items(dataSource: dataSource)) .disposed(by: disposeBag) ```

License: MIT

  • Swift

RxFeedback

Simplest architecture for RxSwift. State + feedback loops.

  • Simple
    • If the system doesn't have state -> congrats, you have either a pure function or an observable sequence
    • It the system does have state, here we are :)
    • Interaction with that state is by definition a feedback loop.
    • => It's just state + CQRS
  • Straightforward
    • if it's state -> State
    • if it's a way to modify state -> Event/Command
    • it it's an effect -> encode it into part of state and then design a feedback loop
  • Declarative
    • System behavior is first declaratively specified and effects begin after subscribe is called => Compile time proof there are no "unhandled states"
  • Debugging is easier

    • A lot of logic is just normal pure function that can be debugged using Xcode debugger, or just printing the commands.
  • Can be applied on any level

    • Entire system
    • application (state is stored inside a database, CoreData, Firebase, Realm)
    • view controller (state is stored inside system operator)
    • inside feedback loop (another system operator inside feedback loop)
  • Works awesome with dependency injection

  • Testing

    • Reducer is a pure function, just call it and assert results
    • In case effects are being tested -> TestScheduler
  • Can model circular dependencies

  • Completely separates business logic from effects (Rx).

    • Business logic can be transpiled between platforms (ShiftJS, C++, J2ObjC)

License: MIT

  • Swift

RxRelay

Because the Observer Design pattern is something every developer should know. It facilitates the communication between objects and simplify the logic of your app. Implementing it in a Reactive way will take it to a whole new level.

License: NOASSERTION

  • Swift

RxSwift

This is a Swift port of ReactiveX.io

Like the original Rx, its intention is to enable easy composition of asynchronous operations and event streams.

It tries to port as many concepts from the original Rx as possible, but some concepts were adapted for more pleasant and performant integration with iOS/macOS/Linux environment.

Probably the best analogy for those who have never heard of Rx would be:

git diff | grep bug | less # linux pipes - programs communicate by sending # sequences of bytes, words, lines, '

License: NOASSERTION

  • Swift

RxTest

Unit testing extensions for RxSwift. This library contains mock schedulers, observables, and observers that should make unit testing your operators easy as unit testing RxSwift built-in operators.

This library contains everything you needed to write unit tests in the following way: ```swift func testMap() { let scheduler = TestScheduler(initialClock: 0)

let xs = scheduler.createHotObservable([
    next(150, 1),
    next(210, 0),
    next(220, 1),
    next(230, 2),
    next(240, 4),
    completed(300)
    ])

let res = scheduler.start { xs.map { $0 * 2 } }

let correctEvents = [
    next(210, 0 * 2),
    next(220, 1 * 2),
    next(230, 2 * 2),
    next(240, 4 * 2),
    completed(300)
]

let correctSubscriptions = [
    Subscription(200, 300)
]

XCTAssertEqual(res.events, correctEvents)
XCTAssertEqual(xs.subscriptions, correctSubscriptions)

} ```

License: NOASSERTION

  • Swift

RxTests

Unit testing extensions for RxSwift. This library contains mock schedulers, observables, and observers that should make unit testing your operators easy as unit testing RxSwift built-in operators.

This library contains everything you needed to write unit tests in the following way: ```swift func testMap() { let scheduler = TestScheduler(initialClock: 0)

let xs = scheduler.createHotObservable([
    next(150, 1),
    next(210, 0),
    next(220, 1),
    next(230, 2),
    next(240, 4),
    completed(300)
    ])

let res = scheduler.start { xs.map { $0 * 2 } }

let correctEvents = [
    next(210, 0 * 2),
    next(220, 1 * 2),
    next(230, 2 * 2),
    next(240, 4 * 2),
    completed(300)
]

let correctSubscriptions = [
    Subscription(200, 300)
]

XCTAssertEqual(res.events, correctEvents)
XCTAssertEqual(xs.subscriptions, correctSubscriptions)

} ```

License:

  • Swift