diff --git a/Sources/WebView/WebView.swift b/Sources/WebView/WebView.swift index a20b1d8..14fb33b 100644 --- a/Sources/WebView/WebView.swift +++ b/Sources/WebView/WebView.swift @@ -17,9 +17,11 @@ public class WebViewStore: ObservableObject { private func setupObservers() { func subscriber(for keyPath: KeyPath) -> NSKeyValueObservation { - return webView.observe(keyPath, options: [.prior]) { _, change in + return webView.observe(keyPath, options: [.prior]) { [weak self] _, change in + guard let self else { return } + if change.isPrior { - self.objectWillChange.send() + objectWillChange.send() } } }