diff --git a/Unio/Wrappers.swift b/Unio/Wrappers.swift index fe9be20..47f1503 100644 --- a/Unio/Wrappers.swift +++ b/Unio/Wrappers.swift @@ -22,13 +22,13 @@ public final class InputWrapper { } /// Accepts `event` and emits it to subscribers via `Input`. - public func accept(_ value: U.Element, for keyPath: KeyPath) { + public func accept(_ value: U.Element, for keyPath: KeyPath) { self[dynamicMember: keyPath](value) } /// Send `event` to this observer via `Input`. - public func accept(for keyPath: KeyPath) -> AnyObserver { + public func accept(for keyPath: KeyPath) -> AnyObserver { return self[dynamicMember: keyPath] } @@ -48,7 +48,7 @@ public final class InputWrapper { /// Accepts `event` and emits it to subscribers via `Input`. /// /// - note: KeyPath Dynamic Member Lookup is avairable greater than Swift5.1 - public subscript(dynamicMember keyPath: KeyPath) -> (U.Element) -> Void { + public subscript(dynamicMember keyPath: KeyPath) -> (U.Element) -> Void { return _dependency[keyPath: keyPath].accept } @@ -56,7 +56,7 @@ public final class InputWrapper { /// Send `event` to this observer via `Input`. /// /// - note: KeyPath Dynamic Member Lookup is avairable greater than Swift5.1 - public subscript(dynamicMember keyPath: KeyPath) -> AnyObserver { + public subscript(dynamicMember keyPath: KeyPath) -> AnyObserver { let relay = _dependency[keyPath: keyPath] return AnyObserver { $0.element.map(relay.accept) }