You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Addame/Addame/Sources/ComposableArchitectureHelpers/NavigationLink+Store.swift
-24Lines changed: 0 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -80,27 +80,3 @@ extension View {
80
80
)
81
81
}
82
82
}
83
-
84
-
/// Converts a closure `(A) -> B?` to a closure that returns last non-`nil` `B` returned by the input closure.
85
-
///
86
-
/// Based on a code from [Thomvis/Construct repository](https://github.com/Thomvis/Construct/blob/f165fd005cd939560c1a4eb8d6ee55075a52685d/Construct/Foundation/Memoize.swift)
/// Combines the reducer with a reducer that works on optionally presented `LocalState`.
12
+
///
13
+
/// - All effects returned by the local reducer are canceled when `LocalState` is `nil`.
14
+
/// - If `LocalAction` is sent when `LocalState` is `nil`:
15
+
/// - The last non-`nil` state value is passed to the local reducer (if available).
16
+
/// - The `LocalState` is unchanged (it stays `nil`).
17
+
/// - All effects returned by the local reducer are immediately canceled.
18
+
///
19
+
/// Based on [Reducer.presents function](https://github.com/pointfreeco/swift-composable-architecture/blob/9ec4b71e5a84f448dedb063a21673e4696ce135f/Sources/ComposableArchitecture/Reducer.swift#L549-L572) from `iso` branch of `swift-composable-architecture` repository.
20
+
///
21
+
/// - Parameters:
22
+
/// - localReducer: A reducer that works on `LocalState`, `LocalAction`, `LocalEnvironment`.
23
+
/// - toLocalState: A key path that can get/set `LocalState?` inside `State`.
24
+
/// - toLocalAction: A case path that can extract/embed `LocalAction` from `Action`.
25
+
/// - toLocalEnvironment: A function that transforms `Environment` into `LocalEnvironment`.
26
+
/// - Returns: A reducer that works on `State`, `Action`, `Environment`.
/// Converts a closure `(A) -> B?` to a closure that returns last non-`nil` `B` returned by the input closure.
9
+
///
10
+
/// Based on a code from [Thomvis/Construct repository](https://github.com/Thomvis/Construct/blob/f165fd005cd939560c1a4eb8d6ee55075a52685d/Construct/Foundation/Memoize.swift)
0 commit comments