Skip to content

Commit 0442bfb

Browse files
authored
Document Store.{state,action}less (#72)
1 parent 22b37b8 commit 0442bfb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/ComposableArchitecture/Store.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,12 @@ public final class Store<State, Action> {
179179
}
180180
}
181181

182+
/// Returns a "stateless" store by erasing state to `Void`.
182183
public var stateless: Store<Void, Action> {
183184
self.scope(state: { _ in () })
184185
}
185186

187+
/// Returns an "actionless" store by erasing action to `Never`.
186188
public var actionless: Store<State, Never> {
187189
func absurd<A>(_ never: Never) -> A {}
188190
return self.scope(state: { $0 }, action: absurd)

0 commit comments

Comments
 (0)