Skip to content

Releases: ivan-magda/swift-debounce

1.0.1

Choose a tag to compare

@ivan-magda ivan-magda released this 13 Oct 21:40
1.0.1
e891854

Fixed

  • Throttler and onChange(of:throttle:) now measure the interval from the moment the action really starts on its actor. Before, it was measured from when the throttler decided to start it, so if the main actor was busy at that moment, the next action could start right after the late one.

Documentation:

1.0.0

Choose a tag to compare

@ivan-magda ivan-magda released this 13 Oct 19:04
1.0.0
dd9e389

The first stable release. From here on, the public API follows Semantic Versioning.

Added

  • DebounceSwiftUI product with onChange(of:debounce:) and onChange(of:throttle:) view modifiers. The action is async, runs on the main actor, never overlaps itself, and is always the closure from the latest view update. The work ends when SwiftUI removes the view or its identity changes.
  • PacingHandle to cancel the pending work of these modifiers, for example when the user submits a search right away.

Documentation:

0.1.0

Choose a tag to compare

@ivan-magda ivan-magda released this 13 Oct 12:32
0.1.0
44c0866

Added

  • Debouncer with leading, trailing, or both edges.
  • Throttler with leading, trailing, or both edges.
  • Synchronous, thread-safe send(_:), plus send() for Void.
  • cancel(); releasing a debouncer or throttler cancels it too.
  • Initializers that take a Duration (iOS 16, macOS 13 and later) or a TimeInterval.

Documentation: https://ivan-magda.github.io/swift-debounce/documentation/debounce/