Replies: 1 comment 1 reply
-
Hey @GaryCorby You can use FuncUI without using (or even referencing) Elmish. All functionality related to Elmish is in a separate Project. Some people really like the MVU model and the I personally, after having used Elm like MVU libraries in production codebases, would advise against it. The React inspired component model, that FuncUI also offers, works a lot better in my opinion. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The idea of a pure F# layer over Avalonia is super interesting, so thanks for putting it together. It seems to work very well.
I've only just been playing around with FuncUI, so this is a question born of 99% ignorance: Why in general would you want to be doing this with Elmish? I read through the source of ElmishHook.fs and I couldn't see that it does anything other than eventually direct you to a function.
As a test I didn't open FuncUI.Elmish. Instead I implemented the type Model{} with a static member this.Create() and a member this.Update(). Then I instantiated the Model type with
let model = Model.Create
The view is defined as "let View() = " without reference to the dispatcher (which doesn't exist) nor the Model (which was instantiated a few lines above).
Within View, calls to model.Update() do the same thing as the dispatcher, as far as I can see. If you want a single Update() method that branches on Msg that works, or else do multiple update methods. Either way you've still implemented an MVU structure. And either way in a real-world system you're probably heading into Fable.Remoting and the SAFE stack anyway.
This all works fine. Or am I wrong?
Beta Was this translation helpful? Give feedback.
All reactions