You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for a pattern for handling global javascript/dom events, such as handling back button navigation ("window.onpopstate").
The reason was to workaround navigation problems with wasm apps, with pushState and popState.
I tried various scenarious, based on https://github.com/TokamakUI/Tokamak/blob/main/Sources/TokamakDOM/App/ColorSchemeObserver.swift, and:
it compiles fine
the event defined in JSClosure is fired, but when I'm sending new value to publisher, it's not received by destination View no matter if I use ObservedObject, or low level publisher + sink.
Looks like some magic sauce is needed to communicate from JSClosure which I'm missing.
Can you provide some example how to do it?
The text was updated successfully, but these errors were encountered:
I'm looking for a pattern for handling global javascript/dom events, such as handling back button navigation ("window.onpopstate").
The reason was to workaround navigation problems with wasm apps, with
pushState
andpopState
.I tried various scenarious, based on
https://github.com/TokamakUI/Tokamak/blob/main/Sources/TokamakDOM/App/ColorSchemeObserver.swift
, and:JSClosure
is fired, but when I'm sending new value to publisher, it's not received by destinationView
no matter if I useObservedObject
, or low level publisher + sink.Looks like some magic sauce is needed to communicate from JSClosure which I'm missing.
Can you provide some example how to do it?
The text was updated successfully, but these errors were encountered: