Yes, the render function would take two inputs now. My example partially 
applied the selectedContactId so List.map was still given a 1-input 
function.

|> List.map (renderContact model.selectedContactId)

No, you wouldn't need to generate new IDs, depending on the application 
workflow. When you add an entity, let the server assign the new ID. Then 
redraw the list with the newly added value.

If I have a list of values (e.g. strings, not entities) that I want to 
manage all at once, then I will generally store that as an array with the 
index basically being the ID. Again, no major ID generation needed. Use 
`List.indexedMap` to render it.

I use the latter for exam question options. Their order doesn't matter 
anyway, because they will be randomized with a seed value (on the server) 
when the exam is delivered.

On Monday, November 7, 2016 at 11:02:20 AM UTC-6, Rickey Barnes wrote:
>
> If you do it that way you would also have to generate unique Ids for each 
> contact somewhere in your update function. And I assume your new render 
> function would take 2 inputs now?

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to