Skip to content

Instantly share code, notes, and snippets.

@rohmanhakim
Created January 3, 2017 20:15
Show Gist options
  • Save rohmanhakim/2e904a352ed6aa8173b94f28f23152ee to your computer and use it in GitHub Desktop.
Save rohmanhakim/2e904a352ed6aa8173b94f28f23152ee to your computer and use it in GitHub Desktop.
// Return true jika email user sudah terpakai
Observable<Boolean> emailStream = RxTextView.textChanges(etEmail)
.map(new Func1<CharSequence, String>() {
@Override
public String call(CharSequence charSequence) {
return charSequence.toString();
}
})
.filter(new Func1<String, Boolean>() {
@Override
public Boolean call(String input) {
return input.length() > 3;
}
})
.debounce(100,TimeUnit.MILLISECONDS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment