1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2025-02-02 18:36:44 +01:00

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

View File

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