From dec82786e712f242e8e54ae81c26f30c61865673 Mon Sep 17 00:00:00 2001 From: Michael Kao Date: Sun, 27 Dec 2020 15:01:30 +0100 Subject: [PATCH] Uses Effect.fireAndForget. --- Examples/Example/Example/AppState.swift | 6 ++---- Examples/Example/Example/Helper.swift | 3 --- README.md | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Examples/Example/Example/AppState.swift b/Examples/Example/Example/AppState.swift index f1c301e..86372db 100644 --- a/Examples/Example/Example/AppState.swift +++ b/Examples/Example/Example/AppState.swift @@ -84,9 +84,7 @@ let appReducer = Reducer { state, action, e state.count = value } - return .fireAndForget { - completion() - } + return .fireAndForget(completion) case .userNotification(.openSettingsForNotification): return .none @@ -110,7 +108,7 @@ let appReducer = Reducer { state, action, e return .concatenate( environment.userNotificationClient.removePendingNotificationRequestsWithIdentifiers(["example_notification"]) - .map(absurd), + .fireAndForget(), environment.userNotificationClient.add(request) .map(Unit.init) .catchToEffect() diff --git a/Examples/Example/Example/Helper.swift b/Examples/Example/Example/Helper.swift index d3e4fcc..0c65942 100644 --- a/Examples/Example/Example/Helper.swift +++ b/Examples/Example/Example/Helper.swift @@ -14,6 +14,3 @@ extension Unit { init(_ void: Void) { } } - -public func absurd(_ never: Never) -> A { -} diff --git a/README.md b/README.md index 0e8b72a..f98bf78 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Adding notification requests is also straight forward. It can be done using `UNN return .concatenate( environment.userNotificationClient.removePendingNotificationRequestsWithIdentifiers(["example_notification"]) - .map(absurd), + .fireAndForget(), environment.userNotificationClient.add(request) .map(Unit.init) .catchToEffect()