Skip to content

Commit

Permalink
Uses Effect.fireAndForget.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miiha committed Dec 27, 2020
1 parent 231def8 commit dec8278
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions Examples/Example/Example/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ let appReducer = Reducer<AppState, AppAction, AppEnvironment> { state, action, e
state.count = value
}

return .fireAndForget {
completion()
}
return .fireAndForget(completion)

case .userNotification(.openSettingsForNotification):
return .none
Expand All @@ -110,7 +108,7 @@ let appReducer = Reducer<AppState, AppAction, AppEnvironment> { state, action, e

return .concatenate(
environment.userNotificationClient.removePendingNotificationRequestsWithIdentifiers(["example_notification"])
.map(absurd),
.fireAndForget(),
environment.userNotificationClient.add(request)
.map(Unit.init)
.catchToEffect()
Expand Down
3 changes: 0 additions & 3 deletions Examples/Example/Example/Helper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ extension Unit {
init(_ void: Void) {
}
}

public func absurd<A>(_ never: Never) -> A {
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dec8278

Please sign in to comment.