fable-compiler / repl

Fable online REPL
http://fable.io/repl
MIT License
64 stars 37 forks source link

Elmish -> simple input example #106

Closed MarcinGajda36 closed 4 years ago

MarcinGajda36 commented 4 years ago

There is error in update method in samples -> Elmish -> simple input currently there is:

let update (msg:Msg) (model:Model) =
    match msg with
    | ChangeValue newValue ->
        { Value = newValue }, Cmd.none

but it should be:

let update (msg:Msg) (model:Model) =
    match msg with
    | ChangeValue newValue ->
        { model with Value = newValue }, Cmd.none

Your current update method is not updating but creating completely new Model. If that is intentional you should not take (model:Model) as argument.

MangelMaxime commented 4 years ago

This is indeed an error