# List, Array, or Dict for a series of dynamic checkboxes

**URL:** <https://discourse.elm-lang.org/t/list-array-or-dict-for-a-series-of-dynamic-checkboxes/2890>\
**Category:** Learn\
**Created:** [January 5, 2019, 5:54pm UTC](https://discourse.elm-lang.org/t/list-array-or-dict-for-a-series-of-dynamic-checkboxes/2890 "2019-01-05T17:54:51Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![joakin](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/joakin/32/171_2.png) [@joakin](https://discourse.elm-lang.org/u/joakin)\
**Post date:** [January 7, 2019, 6:33am UTC](https://discourse.elm-lang.org/t/list-array-or-dict-for-a-series-of-dynamic-checkboxes/2890/14 "2019-01-07T06:33:24Z")

</div>

This post talks a bit about it:

> [@Concurrency and the elm architecture](https://discourse.elm-lang.org/t/concurrency-and-the-elm-architecture/1159/2):
>
> I don’t think this is a concurrency problem, but more a misunderstanding of how views work in Elm. Views will only be updated when the model changes and the browsers triggers a redraw. In most cases, after the model is updated the view will be recalculated somewhere within the next 1/60th of a second. The issue that you see in your example comes when the timer fires and the user also clicks the button inside of that window. Your view ends up using an old model to compute the update. The simplest…

It is not guaranteed that the view will have the latest model always, and you should avoid having logic on it.

Picture that on your model you remove an entry, and the user generated a message on one entry after that one. The message will come from the old model indices. In update you will get a message with an id referring to a different thing than what the user thought because the items shifted.

So if your collection will have arbitrary additions or removals I would personally consider using indexes to send messages on the view dangerous.

---

_[View the full topic](https://discourse.elm-lang.org/t/list-array-or-dict-for-a-series-of-dynamic-checkboxes/2890)._
