Skip to content

Commit 5ce9ee1

Browse files
committed
The action to perform when the player status changes can be set back to nil
1 parent cea0856 commit 5ce9ee1

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Sources/BasicAudioPlayer/BAPlayer/BAPlayer.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,9 @@ public class BAPlayer {
223223
}
224224

225225
// MARK: - Handling Events
226-
226+
227227
/// Adds an action to perform when the player status changes.
228-
///
229-
/// Only the last action added through this method will be evoked when the status changes.
230-
public func onStatusChange(perform action: @escaping (Status) -> Void) {
228+
public func onStatusChange(perform action: ((Status) -> Void)? = nil) {
231229
onStatusChangeHandler = action
232230
}
233231

0 commit comments

Comments
 (0)