Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Dec 13, 2024
1 parent 30bcaf0 commit d9b7af3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/Verge/Store/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ actor Writer {
///
open class Store<State: Equatable, Activity: Sendable>: EventEmitter<_StoreEvent<State, Activity>>, CustomReflectable, StoreType, StoreDriverType, DerivedMaking, @unchecked Sendable {

public let scope: ScopeKeyPath<State> = \State.self
public let scope: any WritableKeyPath<State, State> & Sendable = \State.self

private let tracker = VergeConcurrency.SynchronizationTracker()

Expand Down
6 changes: 2 additions & 4 deletions Sources/Verge/Store/StoreDriverType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public protocol StoreDriverType<Scope>: ObservableObject where Activity == Targe
associatedtype Scope: Equatable = TargetStore.State

var store: TargetStore { get }
var scope: ScopeKeyPath<Scope> { get }
var scope: WritableKeyPath<TargetStore.State, Scope> & Sendable { get }

var state: Changes<Scope> { get }

Expand All @@ -65,8 +65,6 @@ public protocol StoreDriverType<Scope>: ObservableObject where Activity == Targe

extension StoreDriverType {

public typealias ScopeKeyPath<Scope> = WritableKeyPath<TargetStore.State, Scope> & Sendable

public func statePublisher() -> some Combine.Publisher<Changes<TargetStore.State>, Never> {
store.asStore()._statePublisher()
}
Expand All @@ -91,7 +89,7 @@ extension StoreDriverType {

extension StoreDriverType where Scope == TargetStore.State {

public var scope: ScopeKeyPath<TargetStore.State> {
public var scope: WritableKeyPath<TargetStore.State, TargetStore.State> & Sendable {
\TargetStore.State.self
}

Expand Down

0 comments on commit d9b7af3

Please sign in to comment.