This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Dispatch | |
private var throttleItems = Atomic([AnyHashable: ThrottleItem]()) | |
private var debounceItems = Atomic([AnyHashable: DebounceItem]()) | |
extension DispatchQueue { | |
/// First action is executed, then other actions will be performed at most once per specified interval. | |
/// - Note: | |
/// Only the first call's `interval` is taken into account and updated every interval. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SwipeableViewController: NSViewController { | |
private var isHandlingScrollEvent = false | |
private var swipeLeftExecuted = false | |
private var swipeRightExecuted = false | |
private var scrollDeltaX: CGFloat = 0 | |
override func wantsScrollEventsForSwipeTracking(on axis: NSEvent.GestureAxis) -> Bool { | |
return axis == .horizontal | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ThemeEnabler = { | |
isThemeOn: false, | |
controls: null, | |
onAppLoaded: async function() { | |
this.checkCookie() | |
do { |