As Fable.Arch stands today, there is no way to spin up external code, other than hacking around with element IDs and whatnot. No escape hatch.
VirtualDom has such escape hatch in the form of Widgets. I propose to add support for them to Fable.Arch's VirtualDom renderer.
I see an API along these lines:
let myView model =
div [classy "my-component-wrapper"]
[Widget {
init = fun handler ->
let element = Browser.document.createElement "div"
let comp = SuperAwesomeExternalComponent.create element
comp.onSomeEvent (fun e -> handler e.someData)
element
update = fun h e ->
null
} ]
The implementation seems not complicated at all.
I have a working prototype that I can clean up and submit as a PR.
As Fable.Arch stands today, there is no way to spin up external code, other than hacking around with element IDs and whatnot. No escape hatch. VirtualDom has such escape hatch in the form of Widgets. I propose to add support for them to Fable.Arch's VirtualDom renderer.
I see an API along these lines:
The implementation seems not complicated at all. I have a working prototype that I can clean up and submit as a PR.