From 93adb2d2a569aa425dbaa0be973e62685f19de0e Mon Sep 17 00:00:00 2001 From: Alex Usbergo Date: Sun, 31 Oct 2021 11:12:59 +0100 Subject: [PATCH] Public init for PropertyObservable. --- Sources/Primer/PropertyObservable.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/Primer/PropertyObservable.swift b/Sources/Primer/PropertyObservable.swift index 941c402..70b43a5 100644 --- a/Sources/Primer/PropertyObservable.swift +++ b/Sources/Primer/PropertyObservable.swift @@ -17,6 +17,12 @@ public struct AnyPropertyChangeEvent { /// Optional debug label for this event. public let debugLabel: String? + public init(object: Any, keyPath: AnyKeyPath? = nil, debugLabel: String? = nil) { + self.object = object + self.keyPath = keyPath + self.debugLabel = debugLabel + } + /// Returns the tuple `object, value` if this property change matches the `keyPath` passed as /// argument. public func match(keyPath: KeyPath) -> (T, V)? {