Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReducerReader for building reducers out of state and action #1969

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix
  • Loading branch information
stephencelis committed Mar 8, 2023
commit b6d37470dc67aae2f2310fc359474aa1b022fc4d
16 changes: 12 additions & 4 deletions Tests/ComposableArchitectureTests/ReducerReaderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ final class StateReaderTests: XCTestCase {

@Dependency(\.date.now) var now

var body: some ReducerProtocolOf<Self> {
ReducerReader { _, _ in
let _ = self.now
#if swift(>=5.7)
var body: some ReducerProtocol<State, Action> {
ReducerReader { _, _ in
let _ = self.now
}
}
}
#else
var body: Reduce<State, Action> {
ReducerReader { _, _ in
let _ = self.now
}
}
#endif
}

let store = TestStore(initialState: Feature.State(), reducer: Feature()) {
Expand Down