Model
...
items : List Item
...
case msg of
...
OnSubmit updatedItem ->
{ model | items = updateItemById updatedItem }
Any thinking going out there on around naming conventions OOP vs functional? I'd be grateful for any input on this matter of life or death!
listUpdate : Int -> (RecordWithID a -> RecordWithID a) -> List (RecordWithID a) -> List (RecordWithID a)
listUpdate index updatefunction list =
listInsert : Int -> RecordWithID a -> List (RecordWithID a) -> List (RecordWithID a)
listInsert index newRecord list =
type alias RecordWithID a = { a | id : Int }
{ model |
items = model.items |> Dict.insert updatedItem.id updatedItem }
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Elm style puts the items last