Skip to content

Commit

Permalink
Document Store.{state,action}less (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored May 11, 2020
1 parent 22b37b8 commit 0442bfb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/ComposableArchitecture/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,12 @@ public final class Store<State, Action> {
}
}

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

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

0 comments on commit 0442bfb

Please sign in to comment.