feat: add throttle for post compose auto-complete query

This commit is contained in:
CMK 2022-11-14 18:53:09 +08:00
parent 7e7f41112e
commit 2b2707c600
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ final class AutoCompleteViewModel {
inputText inputText
.removeDuplicates() .removeDuplicates()
.receive(on: DispatchQueue.main) .throttle(for: .milliseconds(200), scheduler: DispatchQueue.main, latest: true)
.sink { [weak self] inputText in .sink { [weak self] inputText in
guard let self = self else { return } guard let self = self else { return }
self.stateMachine.enter(State.Loading.self) self.stateMachine.enter(State.Loading.self)