Swiftpack.co - Package - tomoki69386/RxMew

RxMew

RxSwift extensions for Mew.

Installation

Carthage

github "tomoki69386/RxMew"

Example

All the reactive extensions are encapsulated in the rx property of an ContainerView.Container.

let nameObserver = Observable<Int>.interval(.seconds(1), scheduler: MainScheduler.instance)
    .compactMap(String.init)
    .share(replay: 1)

let nameLabelInput = nameObserver
    .map { NameLabelViewController.Input(name: $0) }

let nameButtonInput = nameObserver
    .map { NameButtonViewController.Input(name: $0) }

nameLabelInput
    .bind(to: nameLabelContainer.rx.input)
    .disposed(by: disposeBag)

nameButtonInput
    .bind(to: nameButtonContainer.rx.input)
    .disposed(by: disposeBag)

nameButtonContainer.rx.output.subscribe(onNext: { output in
    guard case let .name(name) = output else {
        assertionFailure("not match")
        return
    }
    print(name)
}).disposed(by: disposeBag)

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

Mew version to 0.4.0 - 2020-10-18 21:18:11

rx property - 2020-10-18 21:14:02

All the reactive extensions are encapsulated in the rx property of an ContainerView.Container.

First Release - 2020-10-07 05:48:45

Reactive extensions are implemented in the _ prefix property of the Container.