Hello everyone, I want to detect my user is typing...
# rx
s
Hello everyone, I want to detect my user is typing on EditText My logical: Send event to server when user type first letter and wait x period ( ex: 3s ) for sending next event to server. Ex: User A 1. Types the word 1 at 154ms => send event to server ->wait 50 ms 2. Types the word 2 at 155ms => no send anything to server 3. Types the word 3 at 156ms => no send anything to server 4. Types the word 4 at 250ms => send event to server ->wait 50 ms Does anyone have an idea about this? Thanks My research about that, maybe can use like this code, but I don’t want to use interval
Copy code
Observable<Long> clock = Observable.interval(500, TimeUnit.MILLISECONDS);
Subject<Long, Long> subjectLong = PublishSubject.create();

clock.subscribe(subjectLong);
z
Seems like one of the throttle/debounce operators could help?
🎉 1
s
Yeah, maybe its great idea.