Skip to content
Merged
Changes from all commits
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
11 changes: 10 additions & 1 deletion Sources/ComposableArchitecture/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ final class ScopedCore<Base: Core, State, Action>: Core {
let base: Base
let stateKeyPath: KeyPath<Base.State, State>
let actionKeyPath: CaseKeyPath<Base.Action, Action>
#if DEBUG
let isInPerceptionTracking = _PerceptionLocals.isInPerceptionTracking
#endif
init(
base: Base,
stateKeyPath: KeyPath<Base.State, State>,
Expand All @@ -216,7 +219,13 @@ final class ScopedCore<Base: Core, State, Action>: Core {
@inlinable
@inline(__always)
var state: State {
base.state[keyPath: stateKeyPath]
#if DEBUG
return _PerceptionLocals.$skipPerceptionChecking.withValue(isInPerceptionTracking) {
base.state[keyPath: stateKeyPath]
}
#else
return base.state[keyPath: stateKeyPath]
#endif
}
@inlinable
@inline(__always)
Expand Down
Loading