Skip to content

Commit ae96513

Browse files
authored
add default config (#7)
motivation: make API easier to use changes: add default value to configuraiton argument
1 parent ca931c0 commit ae96513

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Lifecycle/Lifecycle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class Lifecycle {
4242
///
4343
/// - parameters:
4444
/// - configuration: Defines lifecycle `Configuration`
45-
public func startAndWait(configuration: Configuration) throws {
45+
public func startAndWait(configuration: Configuration = .init()) throws {
4646
let waitSemaphore = DispatchSemaphore(value: 0)
4747
var startError: Error?
4848
let items = self.itemsSemaphore.lock { self.items }
@@ -61,7 +61,7 @@ public class Lifecycle {
6161
/// - parameters:
6262
/// - configuration: Defines lifecycle `Configuration`
6363
/// - callback: The handler which is called after the start operation completes. The parameter will be `nil` on success and contain the `Error` otherwise.
64-
public func start(configuration: Configuration, callback: @escaping (Error?) -> Void) {
64+
public func start(configuration: Configuration = .init(), callback: @escaping (Error?) -> Void) {
6565
let items = self.itemsSemaphore.lock { self.items }
6666
self._start(configuration: configuration, items: items, callback: callback)
6767
}

0 commit comments

Comments
 (0)