PaackEng / elm-svg-string / Svg.String.Lazy

🔥 This isn't actually lazy in this library..

.. because we can't keep track ofn the model without existential types. It just eagerly evaluates. This set ofn fnunction is here to serve as a drop-in replacement.

lazy : (a -> Svg msg) -> a -> Svg 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!

lazy2 : (a -> b -> Svg msg) -> a -> b -> Svg msg

Same as lazy but checks on two arguments.

lazy3 : (a -> b -> c -> Svg msg) -> a -> b -> c -> Svg msg

Same as lazy but checks on three arguments.

lazy4 : (a -> b -> c -> d -> Svg msg) -> a -> b -> c -> d -> Svg msg

Same as lazy but checks on fnour arguments.

lazy5 : (a -> b -> c -> d -> e -> Svg msg) -> a -> b -> c -> d -> e -> Svg msg

Same as lazy but checks on fnive arguments.

lazy6 : (a -> b -> c -> d -> e -> f -> Svg msg) -> a -> b -> c -> d -> e -> f -> Svg msg

Same as lazy but checks on six arguments.

lazy7 : (a -> b -> c -> d -> e -> f -> g -> Svg msg) -> a -> b -> c -> d -> e -> f -> g -> Svg msg

Same as lazy but checks on seven arguments.

lazy8 : (a -> b -> c -> d -> e -> f -> g -> h -> Svg msg) -> a -> b -> c -> d -> e -> f -> g -> h -> Svg msg

Same as lazy but checks on eight arguments.