Closed skinnyjames closed 6 years ago
Hey @skinnyjames, try something like this:
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
ChangePgUser username ->
let
-- What to do here?
oInstall = model.install
nInstall = RemoteData.Success { pgUser = username }
in
({ model | install = nInstall }, Cmd.none)
Apologies if this doesn't belong.
I'm confused as to how to set onInput attributes on a model when it has the type WebData - before it gets sent to the server. Here's an example using elm-mdl. I'm not sure how to set an empty record on the initialModel with a WebData type, and when I try to update the model attributes, it's has a type WebData, so it throws an error.
I'm new to Elm, so I think I'm missing something obvious.
And the error (handling a WebData type)