danielnarey/elm-semantic-dom/1.1.0

NOTE: this package is not compatible with Elm 0.19.1

Dom.Keyed

Support for the VirtualDom keyedNode optimization

From the elm-lang/html documentation:

A keyed node helps optimize cases where children are getting added, moved, removed, etc. Common examples include:

  • The user can delete items from a list.
  • The user can create new items in a list.
  • You can sort a list based on name or date or whatever.

When you use a keyed node, every child is paired with a string identifier. This makes it possible for the underlying diffing algorithm to reuse nodes more efficiently."

container : String -> Bool -> List ( String, Element msg ) -> Element msg

Construct a container element where the child nodes are keyed with unique identifiers in order to optimize updates to the Dom; the first argument gives the tag, the second argument is a boolean indicating whether the lazy optimization should also be applied to the keyed children, and the third argument is a list of keyed element records.

String
-> List (Property msg)
-> List ( String, Node msg )
-> Node msg

Alias for VirtualDom.keyedNode