stefanrenne/RxSonosLib

View on GitHub
RxSonosLib/Framework/Common/Protocol/CompletableInteractor.swift

Summary

Maintainability
A
0 mins
Test Coverage
//
//  CompletableInteractor.swift
//  iOS Demo App
//
//  Created by Stefan Renne on 30/12/2018.
//  Copyright © 2018 Uberweb. All rights reserved.
//

import Foundation
import RxSwift

protocol CompletableInteractor: Interactor {
    
    func get() -> Completable
    
    func get(values: T?) -> Completable
    
    func buildInteractorObservable(values: T?) -> Completable
}

extension CompletableInteractor {
    
    func get() -> Completable {
        return get(values: nil)
    }
    
    func get(values: T?) -> Completable {
        return buildInteractorObservable(values: values)
            .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .default))
            .observeOn(MainScheduler.instance)
    }
    
}