diff --git a/Example/example-app/Package.swift b/Example/example-app/Package.swift index 3b02bf979acbbd2d44d20cc04eca3ad9dc4a8ce9..6277f61915b66b8a2b169c44f06f3cd97fd02b49 100644 --- a/Example/example-app/Package.swift +++ b/Example/example-app/Package.swift @@ -139,6 +139,10 @@ let package = Package( name: "ComposableArchitecture", package: "swift-composable-architecture" ), + .product( + name: "ElixxirDAppsSDK", + package: "elixxir-dapps-sdk-swift" + ), ], swiftSettings: swiftSettings ), diff --git a/Example/example-app/Sources/AppFeature/App.swift b/Example/example-app/Sources/AppFeature/App.swift index 1353882a744740f111d93562021f892f3108d5a9..1af9cbbe587b02f3da91be1a324729d1f1f155e6 100644 --- a/Example/example-app/Sources/AppFeature/App.swift +++ b/Example/example-app/Sources/AppFeature/App.swift @@ -40,7 +40,9 @@ extension AppEnvironment { mainScheduler: mainScheduler, error: ErrorEnvironment() ), - session: SessionEnvironment() + session: SessionEnvironment( + getClient: { clientSubject.value } + ) ) } } diff --git a/Example/example-app/Sources/SessionFeature/SessionFeature.swift b/Example/example-app/Sources/SessionFeature/SessionFeature.swift index 3b7dd16fe1aecf92658f3d9e2508b2fefc20927a..c98f2d4d8581bc1c56ef64ce234f1b35d7a30e55 100644 --- a/Example/example-app/Sources/SessionFeature/SessionFeature.swift +++ b/Example/example-app/Sources/SessionFeature/SessionFeature.swift @@ -1,4 +1,5 @@ import ComposableArchitecture +import ElixxirDAppsSDK public struct SessionState: Equatable { public init() {} @@ -9,7 +10,13 @@ public enum SessionAction: Equatable { } public struct SessionEnvironment { - public init() {} + public init( + getClient: @escaping () -> Client? + ) { + self.getClient = getClient + } + + public var getClient: () -> Client? } public let sessionReducer = Reducer<SessionState, SessionAction, SessionEnvironment> @@ -22,6 +29,8 @@ public let sessionReducer = Reducer<SessionState, SessionAction, SessionEnvironm #if DEBUG extension SessionEnvironment { - public static let failing = SessionEnvironment() + public static let failing = SessionEnvironment( + getClient: { .failing } + ) } #endif