Objects { fun okHttpClient(): OkHttpClient = OkHttpClient.Builder().build() fun retrofit(okHttpClient: OkHttpClient): Retrofit = Retrofit.Builder().client(okHttpClient).baseUrl(“") .addCallAdapterFactory(RxJava2CallAdapterFactory .createAsync()).build() fun service(retrofit: Retrofit): Service = retrofit.create(Service::class.java) fun api(service: Service): Api = ApiClient(service) } }
Objects { fun okHttpClient(): OkHttpClient = OkHttpClient.Builder().build() fun retrofit(okHttpClient: OkHttpClient): Retrofit = Retrofit.Builder().client(okHttpClient).baseUrl(“") .addCallAdapterFactory(RxJava2CallAdapterFactory .createAsync()).build() fun service(retrofit: Retrofit): Service = retrofit.create(Service::class.java) fun api(service: Service): Api = ApiClient(service) } }
Objects { fun okHttpClient(): OkHttpClient = OkHttpClient.Builder().build() fun retrofit(okHttpClient: OkHttpClient): Retrofit = Retrofit.Builder().client(okHttpClient).baseUrl(“") .addCallAdapterFactory(RxJava2CallAdapterFactory .createAsync()) .build() fun service(retrofit: Retrofit): Service = retrofit.create(Service::class.java) fun api(service: Service): Api = ApiClient(service) } }