dmytroivanovv’s gists · GitHub


dmytroivanovv’s gists · GitHub

Instantly share code, notes, and snippets.

View view_model_impl

class SearchViewModel(
val schedulers: ISchedulerProvider,
val searchRepository: ISearchRepository,
val searchMapper: ISearchMapper
) : ViewModel(), ISearchViewModel {
private val compositeDisposable: CompositeDisposable = CompositeDisposable()
private val rxSearchQuery: BehaviorSubject<String> = BehaviorSubject.createDefault(“”)
override val searchResultState: MutableLiveData<SearchResultState> = MutableLiveData()

View view_model_interface

interface ISearchViewModel {
val searchResultState: LiveData<SearchResultState>
fun search(text: String)
}

View telegram_search_state

sealed class SearchResultState {
object Loading : SearchResultState()
object Empty : SearchResultState()
data class Items(val items: List<SearchResultItem>): SearchResultState()
data class Error(val throwable: Throwable): SearchResultState()
}

View gist:d8ec4bd2cf2971e1c37360dd888911fb

sealed class SearchResultState {
object Loading : SearchResultState()
object Empty : SearchResultState()
data class Items(val items: List<SearchResultItem>): SearchResultState()
data class Error(val throwable: Throwable): SearchResultState()
}

View gist:7939d8dc47c14615bfae635e98a8f07c

public final class DaggerMyComponent implements MyComponent {
private DaggerMyComponent() {
}
public static Builder builder() {
return new Builder();
}
public static MyComponent create() {

View gist:9885e19cf115c90705b6fcb02e24ea16

public final class DaggerMyComponent implements MyComponent {
private DaggerMyComponent() {
}
public static Builder builder() {
return new Builder();
}
public static MyComponent create() {

View gist:79fd67cba9c6026a1a2d57c936adf81c

public final class DaggerMyComponent implements MyComponent {
private DaggerMyComponent() {
}
public static Builder builder() {
return new Builder();
}
public static MyComponent create() {

View gist:76f007a6eac601ac68463bc1c0e62a77

public final class DaggerMyComponent implements MyComponent {
private DaggerMyComponent() {
}
public static Builder builder() {
return new Builder();
}
public static MyComponent create() {


You can’t perform that action at this time.

Read about:   feed.xml · GitHub

Leave a Reply

Your email address will not be published.