diff --git a/Sources/Verge/Store/Store.swift b/Sources/Verge/Store/Store.swift index eb306a3caa..aeaef7c04c 100644 --- a/Sources/Verge/Store/Store.swift +++ b/Sources/Verge/Store/Store.swift @@ -93,7 +93,7 @@ actor Writer { /// open class Store: EventEmitter<_StoreEvent>, CustomReflectable, StoreType, StoreDriverType, DerivedMaking, @unchecked Sendable { - public let scope: ScopeKeyPath = \State.self + public let scope: any WritableKeyPath & Sendable = \State.self private let tracker = VergeConcurrency.SynchronizationTracker() diff --git a/Sources/Verge/Store/StoreDriverType.swift b/Sources/Verge/Store/StoreDriverType.swift index 90f179bb06..44e85afaea 100644 --- a/Sources/Verge/Store/StoreDriverType.swift +++ b/Sources/Verge/Store/StoreDriverType.swift @@ -54,7 +54,7 @@ public protocol StoreDriverType: ObservableObject where Activity == Targe associatedtype Scope: Equatable = TargetStore.State var store: TargetStore { get } - var scope: ScopeKeyPath { get } + var scope: WritableKeyPath & Sendable { get } var state: Changes { get } @@ -65,8 +65,6 @@ public protocol StoreDriverType: ObservableObject where Activity == Targe extension StoreDriverType { - public typealias ScopeKeyPath = WritableKeyPath & Sendable - public func statePublisher() -> some Combine.Publisher, Never> { store.asStore()._statePublisher() } @@ -91,7 +89,7 @@ extension StoreDriverType { extension StoreDriverType where Scope == TargetStore.State { - public var scope: ScopeKeyPath { + public var scope: WritableKeyPath & Sendable { \TargetStore.State.self }