Skip to content

Commit

Permalink
space escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
DangWW committed Jan 13, 2025
1 parent 1d19d9c commit f16bad2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Lasso/SwiftUI+Lasso/SwiftUI+Bindings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ import SwiftUI
extension AnyViewStore {

public func binding<T>(_ keyPath: WritableKeyPath<ViewState, T>,
action: @escaping(T) -> ViewAction) -> Binding<T> {
action: @escaping (T) -> ViewAction) -> Binding<T> {
return Binding(get: { self.state[keyPath: keyPath] },
set: { value in self.dispatchAction(action(value)) })
}

public func binding<SourceValue, BoundValue>(_ keyPath: WritableKeyPath<ViewState, SourceValue>,
value: @escaping(SourceValue) -> BoundValue,
action: @escaping(BoundValue) -> ViewAction) -> Binding<BoundValue> {
value: @escaping (SourceValue) -> BoundValue,
action: @escaping (BoundValue) -> ViewAction) -> Binding<BoundValue> {
return Binding(get: { value(self.state[keyPath: keyPath]) },
set: { value in self.dispatchAction(action(value)) })
}
Expand Down

0 comments on commit f16bad2

Please sign in to comment.