From fdb4633d3e9158e457d57e820df6e1efb4df39c2 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sun, 7 May 2023 15:22:54 +0200 Subject: Update to support notes + new style --- Map/Debouncer.swift | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 Map/Debouncer.swift (limited to 'Map/Debouncer.swift') diff --git a/Map/Debouncer.swift b/Map/Debouncer.swift deleted file mode 100644 index cd7960a..0000000 --- a/Map/Debouncer.swift +++ /dev/null @@ -1,21 +0,0 @@ -import Foundation - -class Debouncer { - - // MARK: - Properties - private let queue = DispatchQueue.global(qos: .utility) - private var workItem = DispatchWorkItem(block: {}) - private var interval: TimeInterval - - // MARK: - Initializer - init(seconds: TimeInterval) { - self.interval = seconds - } - - // MARK: - Debouncing function - func debounce(action: @escaping (() -> Void)) { - workItem.cancel() - workItem = DispatchWorkItem(block: { action() }) - queue.asyncAfter(deadline: .now() + interval, execute: workItem) - } -} -- cgit