I want to create reactive Extensions for an Custom instance function, wich is currently using Closures for Callbacks.
I’m able to write the Extension, but the “.rx” is not showing up in my code.
function:
public func refreshChapter(chapter: Chapter, force: Bool, success: @escaping ()->Void, failure: @escaping (Error)->Void)
extension:
import Foundation
import RxSwift
import imiji_AppleCore
public extension Reactive where Base: imiji_AppleCore.Api {
static func refreshCapter(chapter: Chapter, force: Bool) -> Observable<Void> {
return Observable.create({ (obs) -> Disposable in
Api.api.refreshChapter(chapter: chapter, force: force, success: {
obs.onCompleted()
}, failure: { (error) in
obs.onError(error)
})
return Disposables.create()
})
}
}
Is there a prerequisite on Reactive Base?