Skip to content

Commit 272d1f5

Browse files
authored
expose shutdownIfNotStarted argument on regsiter (#83)
motivation: in some cases, users want to force shutdown even if start never called, for example if the library asserts for shutdown regardless of start changes: expose shutdownIfNotStarted on regsiter function
1 parent 1e2fa84 commit 272d1f5

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

.xcodesamplecode.plist

Lines changed: 0 additions & 5 deletions
This file was deleted.

Sources/Lifecycle/Lifecycle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ extension LifecycleTasksContainer {
504504
/// - label: label of the item, useful for debugging.
505505
/// - start: `Handler` to perform the startup.
506506
/// - shutdown: `Handler` to perform the shutdown.
507-
public func register(label: String, start: LifecycleHandler, shutdown: LifecycleHandler) {
508-
self.register(_LifecycleTask(label: label, shutdownIfNotStarted: nil, start: start, shutdown: shutdown))
507+
public func register(label: String, start: LifecycleHandler, shutdown: LifecycleHandler, shutdownIfNotStarted: Bool? = nil) {
508+
self.register(_LifecycleTask(label: label, shutdownIfNotStarted: shutdownIfNotStarted, start: start, shutdown: shutdown))
509509
}
510510

511511
/// Adds a `LifecycleTask` to a `LifecycleTasks` collection.

0 commit comments

Comments
 (0)