I have been trying to implement this feature where I have to search for every keyword the user types but I have this limitation that I can hit the server only after 1 sec of the previous call. So if I'm typing a, b, c, d the hit should work like that a --- 1 second interval--- ab --- 1 second interval--- abc --- 1 second interval--- abcd
I tried using debounce, delay( caused looper exception ). Can somebody tell me how can I achieve it using RxJava(Android).
public Observable<String> userTypings() {
return RxTextView.textChanges(inputText).skip(1).flatMap(new Func1<CharSequence, Observable<String>>() {
@Override
public Observable<String> call(CharSequence charSequence) {
return Observable.just(charSequence.toString());
}
});
}
This is how the emission of events is being done in View of the MVP pattern. Comment if you need anything else!