Skip to content

Commit

Permalink
Bug in Async.debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Kiefer committed May 15, 2019
1 parent dd12bcd commit aa6c8ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Core/Source/Async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ extension Async {
var lastWorkItem: DispatchWorkItem?
return {
lastWorkItem?.cancel()
let time: DispatchTime = DispatchTime.now()
let time: DispatchTime = DispatchTime.now() + interval
let nextWorkItem = DispatchWorkItem { lastWorkItem = nil; block() }
DispatchQueue.main.asyncAfter(deadline: time, execute: nextWorkItem)
lastWorkItem = nextWorkItem
Expand Down

0 comments on commit aa6c8ed

Please sign in to comment.