package com.rightfromleftsw.weather.domain.interactor

import com.rightfromleftsw.weather.domain.executor.PostExecutionThread
import com.rightfromleftsw.weather.domain.executor.ThreadExecutor
import com.rightfromleftsw.weather.domain.interactor.base.SingleUseCase
import com.rightfromleftsw.weather.domain.model.Location
import com.rightfromleftsw.weather.domain.repository.IWeatherRepository
import io.reactivex.Single
import javax.inject.Inject

/**
 * Created by clivelee on 9/21/17.
 */
open class GetLocation @Inject constructor(val weatherRepository: IWeatherRepository,
                                           threadExecutor: ThreadExecutor,
                                           postExecutionThread: PostExecutionThread):
        SingleUseCase<Location, Void?>(threadExecutor, postExecutionThread) {

    public override fun buildUseCaseObservable(params: Void?): Single<Location> {
        return weatherRepository.getLocation()
    }
}
