Skip to content

Commit

Permalink
πŸ› Fixed WritableKeyPath to reference one
Browse files Browse the repository at this point in the history
  • Loading branch information
SwiftyJunnos committed Oct 9, 2024
1 parent 369fea5 commit efaedb7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/Dripper/Station.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public final class Station<State: ObservableState, Action> {
}

public subscript<Member>(
dynamicMember dynamicMember: WritableKeyPath<State, Member>
dynamicMember dynamicMember: ReferenceWritableKeyPath<State, Member>
) -> Member {
get {
state[keyPath: dynamicMember]
Expand All @@ -80,7 +80,9 @@ public final class Station<State: ObservableState, Action> {
}

extension Station where State: AnyObject {
public func bind<Member>(_ dynamicMember: WritableKeyPath<State, Member>) -> Binding<Member> {
public func bind<Member>(
_ dynamicMember: ReferenceWritableKeyPath<State, Member>
) -> Binding<Member> {
Binding(
get: {
self.state[keyPath: dynamicMember]
Expand Down

0 comments on commit efaedb7

Please sign in to comment.