Skip to content

Commit

Permalink
Merge pull request #15 from canopas/add-stack-property
Browse files Browse the repository at this point in the history
Allow accessing stack from UIPilot
  • Loading branch information
jimmy0251 authored Apr 9, 2022
2 parents 448cd64 + 6708e9e commit adb961d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/UIPilot/UIPilot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public class UIPilot<T: Equatable>: ObservableObject {
let logger: Logger
var state: UIPilotViewState<T>!

public var stack: [T] {
return paths.map { $0.route }
}

public init(initial: T, debug: Bool = false) {
logger = debug ? DebugLog() : EmptyLog()
logger.log("UIPilot - Pilot Initialized.")
Expand Down

0 comments on commit adb961d

Please sign in to comment.