Skip to content

Commit

Permalink
♻️ :: deinit에서 cancel과 같은 액션을 하는것을 cancel호출만으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Jun 21, 2023
1 parent 5f47db9 commit 5c4da8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Sources/EventLimiter/Debouncer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ public final class Debouncer {
}

deinit {
self.task?.cancel()
self.task = nil
self.cancel()
}

public func callAsFunction(action: @escaping () async throws -> Void) {
Expand Down
4 changes: 1 addition & 3 deletions Sources/EventLimiter/Throttler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ public final class Throttler {
}

deinit {
self.task?.cancel()
self.task = nil
self.action = nil
self.cancel()
}

public func callAsFunction(
Expand Down

0 comments on commit 5c4da8b

Please sign in to comment.