Skip to content

Commit

Permalink
throttle fix
Browse files Browse the repository at this point in the history
  • Loading branch information
psharanda committed Apr 26, 2017
1 parent 74f871f commit f072a4a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Sources/Observable+Filtering.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ extension Observable {
return self.subscribe { result in
let newDate = Date()
lastIgnoredValue = result
lastAfterCancel?.dispose()
lastAfterCancel = nil
if newDate.timeIntervalSince(lastUpdateTime) >= timeInterval {
lastAfterCancel?.dispose()
lastAfterCancel = nil
lastUpdateTime = newDate
lastIgnoredValue = nil
observer(result)

observer(result)
if latest {
lastAfterCancel = queue.jx_after(timeInterval: timeInterval) {
guard let lastIgnoredValue = lastIgnoredValue else { return }
Expand Down

0 comments on commit f072a4a

Please sign in to comment.