From d736925a0f59cd580ca6b676814c86eaeed8ddb8 Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Fri, 7 Oct 2022 12:44:20 +0200
Subject: [PATCH] Fix usage of unimplemented in release mode

---
 Examples/xx-messenger/Sources/AppFeature/AppFeature.swift       | 2 ++
 Examples/xx-messenger/Sources/HomeFeature/HomeFeature.swift     | 2 ++
 .../xx-messenger/Sources/RegisterFeature/RegisterFeature.swift  | 2 ++
 .../xx-messenger/Sources/RestoreFeature/RestoreFeature.swift    | 2 ++
 .../xx-messenger/Sources/WelcomeFeature/WelcomeFeature.swift    | 2 ++
 5 files changed, 10 insertions(+)

diff --git a/Examples/xx-messenger/Sources/AppFeature/AppFeature.swift b/Examples/xx-messenger/Sources/AppFeature/AppFeature.swift
index 07be9948..7796f592 100644
--- a/Examples/xx-messenger/Sources/AppFeature/AppFeature.swift
+++ b/Examples/xx-messenger/Sources/AppFeature/AppFeature.swift
@@ -59,6 +59,7 @@ struct AppEnvironment {
   var home: () -> HomeEnvironment
 }
 
+#if DEBUG
 extension AppEnvironment {
   static let unimplemented = AppEnvironment(
     dbManager: .unimplemented,
@@ -74,6 +75,7 @@ extension AppEnvironment {
     home: { .unimplemented }
   )
 }
+#endif
 
 let appReducer = Reducer<AppState, AppAction, AppEnvironment>
 { state, action, env in
diff --git a/Examples/xx-messenger/Sources/HomeFeature/HomeFeature.swift b/Examples/xx-messenger/Sources/HomeFeature/HomeFeature.swift
index 87a51600..f2015ebc 100644
--- a/Examples/xx-messenger/Sources/HomeFeature/HomeFeature.swift
+++ b/Examples/xx-messenger/Sources/HomeFeature/HomeFeature.swift
@@ -115,6 +115,7 @@ public struct HomeEnvironment {
   public var backup: () -> BackupEnvironment
 }
 
+#if DEBUG
 extension HomeEnvironment {
   public static let unimplemented = HomeEnvironment(
     messenger: .unimplemented,
@@ -127,6 +128,7 @@ extension HomeEnvironment {
     backup: { .unimplemented }
   )
 }
+#endif
 
 public let homeReducer = Reducer<HomeState, HomeAction, HomeEnvironment>
 { state, action, env in
diff --git a/Examples/xx-messenger/Sources/RegisterFeature/RegisterFeature.swift b/Examples/xx-messenger/Sources/RegisterFeature/RegisterFeature.swift
index 9b9754c6..f8fdabef 100644
--- a/Examples/xx-messenger/Sources/RegisterFeature/RegisterFeature.swift
+++ b/Examples/xx-messenger/Sources/RegisterFeature/RegisterFeature.swift
@@ -62,6 +62,7 @@ public struct RegisterEnvironment {
   public var bgQueue: AnySchedulerOf<DispatchQueue>
 }
 
+#if DEBUG
 extension RegisterEnvironment {
   public static let unimplemented = RegisterEnvironment(
     messenger: .unimplemented,
@@ -71,6 +72,7 @@ extension RegisterEnvironment {
     bgQueue: .unimplemented
   )
 }
+#endif
 
 public let registerReducer = Reducer<RegisterState, RegisterAction, RegisterEnvironment>
 { state, action, env in
diff --git a/Examples/xx-messenger/Sources/RestoreFeature/RestoreFeature.swift b/Examples/xx-messenger/Sources/RestoreFeature/RestoreFeature.swift
index 4d372202..6b3d61d3 100644
--- a/Examples/xx-messenger/Sources/RestoreFeature/RestoreFeature.swift
+++ b/Examples/xx-messenger/Sources/RestoreFeature/RestoreFeature.swift
@@ -82,6 +82,7 @@ public struct RestoreEnvironment {
   public var bgQueue: AnySchedulerOf<DispatchQueue>
 }
 
+#if DEBUG
 extension RestoreEnvironment {
   public static let unimplemented = RestoreEnvironment(
     messenger: .unimplemented,
@@ -92,6 +93,7 @@ extension RestoreEnvironment {
     bgQueue: .unimplemented
   )
 }
+#endif
 
 public let restoreReducer = Reducer<RestoreState, RestoreAction, RestoreEnvironment>
 { state, action, env in
diff --git a/Examples/xx-messenger/Sources/WelcomeFeature/WelcomeFeature.swift b/Examples/xx-messenger/Sources/WelcomeFeature/WelcomeFeature.swift
index 5bfe8148..66e9ef1b 100644
--- a/Examples/xx-messenger/Sources/WelcomeFeature/WelcomeFeature.swift
+++ b/Examples/xx-messenger/Sources/WelcomeFeature/WelcomeFeature.swift
@@ -38,6 +38,7 @@ public struct WelcomeEnvironment {
   public var bgQueue: AnySchedulerOf<DispatchQueue>
 }
 
+#if DEBUG
 extension WelcomeEnvironment {
   public static let unimplemented = WelcomeEnvironment(
     messenger: .unimplemented,
@@ -45,6 +46,7 @@ extension WelcomeEnvironment {
     bgQueue: .unimplemented
   )
 }
+#endif
 
 public let welcomeReducer = Reducer<WelcomeState, WelcomeAction, WelcomeEnvironment>
 { state, action, env in
-- 
GitLab