This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
a tiny library to print any record to DOM or to console
version 1.0.0
license BSD3
native-modules False
elm-version 0.17.0 <= v < 0.18.0
Tag 1.0.0
Committed At 2016-11-13 21:10:39 UTC
elm-lang/html 1.1.0 <= v < 2.0.0 1.1.0
elm-lang/core 4.0.5 <= v < 5.0.0 4.0.5

Modules

README

elm-print-any

A quick & dirty helper to render any record type to the DOM, for debugging purposes.

When you are dealing with large models or large records, with many fields of different shapes, you sometimes want to be able to inspect that model. Then the straightforward Debug.log "my model" model to print the model to the console will give you a "minified" and unreadable version of your model. Especially if there are lists in it.

The helper view function in this tiny library will print any record type to your DOM. Anywhere in your view function, you can do:

view model =
    div []
        [ ...
        , PrintAny.view model
        ]

The output is a <div> with a list of indented <p> paragraphs in it.

The helper log prints a somewhat prettified version of the record to the console. It works similar to Debug.log Usage is as follows:

myNewRecord = PrintAny.log myRecord

Typical use case would be: your app renders a view that is different from what you expected. And you want to inspect the contents of your model at the time of rendering.

Both functions help you do just that.

If your record is really large, rendering will be slow.