From dda2134c56e115415940fb47460d43db4db89734 Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Thu, 2 Jun 2022 23:10:28 +0200 Subject: [PATCH] Add DependenciesProvider --- .../DependenciesProvider.swift | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Sources/ElixxirDAppsSDK/DependenciesProvider.swift diff --git a/Sources/ElixxirDAppsSDK/DependenciesProvider.swift b/Sources/ElixxirDAppsSDK/DependenciesProvider.swift new file mode 100644 index 00000000..d9168cd1 --- /dev/null +++ b/Sources/ElixxirDAppsSDK/DependenciesProvider.swift @@ -0,0 +1,19 @@ +import Bindings + +public struct DependenciesProvider { + public var get: () -> String + + public func callAsFunction() -> String { + get() + } +} + +extension DependenciesProvider { + public static let live = DependenciesProvider(get: BindingsGetDependencies) +} + +#if DEBUG +extension DependenciesProvider { + public static let failing = DependenciesProvider { fatalError("Not implemented") } +} +#endif -- GitLab