miniBill / elm-html-with-context / Html.WithContext.Lazy

lazy6 : (a -> b -> c -> d -> e -> f -> Html.WithContext.Html context msg) -> a -> b -> c -> d -> e -> f -> Html.WithContext.Html context msg

Same as lazy but checks on six arguments.

lazy5 : (a -> b -> c -> d -> e -> Html.WithContext.Html context msg) -> a -> b -> c -> d -> e -> Html.WithContext.Html context msg

Same as lazy but checks on five arguments.

lazy4 : (a -> b -> c -> d -> Html.WithContext.Html context msg) -> a -> b -> c -> d -> Html.WithContext.Html context msg

Same as lazy but checks on four arguments.

lazy3 : (a -> b -> c -> Html.WithContext.Html context msg) -> a -> b -> c -> Html.WithContext.Html context msg

Same as lazy but checks on three arguments.

lazy2 : (a -> b -> Html.WithContext.Html context msg) -> a -> b -> Html.WithContext.Html context msg

Same as lazy but checks on two arguments.

lazy : (a -> Html.WithContext.Html context msg) -> a -> Html.WithContext.Html context msg

A performance optimization that delays the building of virtual DOM nodes.

Calling (view model) will definitely build some virtual DOM, perhaps a lot of it. Calling (lazy view model) delays the call until later. During diffing, we can check to see if model is referentially equal to the previous value used, and if so, we just stop. No need to build up the tree structure and diff it, we know if the input to view is the same, the output must be the same!