opvasger/msg-replay/1.0.1

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/opvasger/msg-replay is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with the same repo name found; no cached copy. Use another version.

Details

Elm Msg Replay

This package implements reliable hot-reloading based on the Elm-architecture.

It is sheer delight to build graphics without having to get the application back into a certain state in between making changes.

Automatic Message-Replay

Demo Gif

The only case where replay can be limited, is when a message is removed from code, and the application is restarted. In this case, replay happens up until that message and stops. This is optimal.

If we ignore limited replay, it essentially works like this:

init flags =
    ( List.foldl (\msg model -> Tuple.first (update msg model))
        initModel 
        (decodeListOfMsg flags.msgs)
    , Cmd.none
    )

update msg model =
    case msg of
        DoStuff ->
            ( doStuff model
            , saveMsgOverPort (encode msg)
            )

One really interesting aspect of automatic message-replay, is how a program behaves when the update-function is modified.

If you run through the correct set of actions to reach a certain state, but you're not quite there, you can tweak the update-function of your program, and simply reload the program to see if you're done yet.