1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00

Adapt NvimView to RxSwift 5

This commit is contained in:
Tae Won Ha 2019-05-01 08:09:09 +02:00
parent 9040c812cc
commit 648236489c
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
5 changed files with 12 additions and 13 deletions

View File

@ -1,5 +1,5 @@
# included as Framework # included as Framework
github "ReactiveX/RxSwift" == 4.4.2 github "ReactiveX/RxSwift" == 5.0.1
github "PureLayout/PureLayout" == 3.1.4 github "PureLayout/PureLayout" == 3.1.4
github "qvacua/Sparkle" == 1.21.3-qvacua github "qvacua/Sparkle" == 1.21.3-qvacua
github "qvacua/CocoaFontAwesome" "master" github "qvacua/CocoaFontAwesome" "master"
@ -7,7 +7,7 @@ github "qvacua/CocoaMarkdown" "master"
github "qvacua/swifter" "nonpublic" github "qvacua/swifter" "nonpublic"
github "a2/MessagePack.swift" == 3.0.0 github "a2/MessagePack.swift" == 3.0.0
github "qvacua/ShortcutRecorder" "temporary" github "qvacua/ShortcutRecorder" "temporary"
github "IBM-Swift/BlueSocket" == 1.0.45 github "IBM-Swift/BlueSocket" == 1.0.46
# included directly # included directly
github "eonil/FSEvents" "master" github "eonil/FSEvents" "master"

View File

@ -1,7 +1,7 @@
github "IBM-Swift/BlueSocket" "1.0.45" github "IBM-Swift/BlueSocket" "1.0.46"
github "PureLayout/PureLayout" "v3.1.4" github "PureLayout/PureLayout" "v3.1.4"
github "Quick/Nimble" "v8.0.1" github "Quick/Nimble" "v8.0.1"
github "ReactiveX/RxSwift" "4.4.2" github "ReactiveX/RxSwift" "5.0.1"
github "a2/MessagePack.swift" "3.0.0" github "a2/MessagePack.swift" "3.0.0"
github "elegantchaos/DictionaryCoding" "1.0.6" github "elegantchaos/DictionaryCoding" "1.0.6"
github "eonil/FSEvents" "9723002bc2d9f596a56a63420deab30f9f670b86" github "eonil/FSEvents" "9723002bc2d9f596a56a63420deab30f9f670b86"

View File

@ -6,8 +6,7 @@
import Foundation import Foundation
import RxSwift import RxSwift
extension PrimitiveSequence extension PrimitiveSequence where Element == Never, Trait == CompletableTrait {
where Element == Never, TraitType == CompletableTrait {
func wait( func wait(
onCompleted: (() -> Void)? = nil, onCompleted: (() -> Void)? = nil,

View File

@ -89,7 +89,7 @@ class UiBridge {
// This will be completed in .nvimReady branch of handleMessage() // This will be completed in .nvimReady branch of handleMessage()
return Disposables.create() return Disposables.create()
}) })
.timeout(timeout, scheduler: self.scheduler) .timeout(.seconds(timeout), scheduler: self.scheduler)
} }
func deleteCharacters(_ count: Int, andInputEscapedString string: String) func deleteCharacters(_ count: Int, andInputEscapedString string: String)
@ -347,4 +347,4 @@ class UiBridge {
} }
} }
private let timeout = CFTimeInterval(5) private let timeout = 5

View File

@ -8,7 +8,9 @@ import RxSwift
extension ObservableType { extension ObservableType {
func compactMap<R>(_ transform: @escaping (E) throws -> R?) -> Observable<R> { func compactMap<R>(
_ transform: @escaping (Element) throws -> R?
) -> Observable<R> {
return self return self
.map(transform) .map(transform)
.filter { $0 != nil } .filter { $0 != nil }
@ -16,8 +18,7 @@ extension ObservableType {
} }
} }
extension PrimitiveSequence extension PrimitiveSequence where Element == Never, Trait == CompletableTrait {
where Element == Never, TraitType == CompletableTrait {
func andThen(using body: () -> Completable) -> Completable { func andThen(using body: () -> Completable) -> Completable {
return self.andThen(body()) return self.andThen(body())
@ -59,7 +60,7 @@ extension PrimitiveSequence
} }
} }
extension PrimitiveSequence where TraitType == SingleTrait { extension PrimitiveSequence where Trait == SingleTrait {
static func fromSinglesToSingleOfArray( static func fromSinglesToSingleOfArray(
_ singles: [Single<Element>] _ singles: [Single<Element>]
@ -67,7 +68,6 @@ extension PrimitiveSequence where TraitType == SingleTrait {
return Observable return Observable
.merge(singles.map { $0.asObservable() }) .merge(singles.map { $0.asObservable() })
.toArray() .toArray()
.asSingle()
} }
func flatMapCompletable( func flatMapCompletable(