elm-community / undo-redo / UndoList.Encode

Encode UndoList submodule.

Provides JSON encoders for Timelines and UndoList Messages.

Encoders

undolist : UndoList Json.Encode.Value -> Json.Encode.Value

Encode an undolist of JSON values. Best paired with the map function from UndoList.

encodeUndoList stateEncoder =
    UndoList.map stateEncoder >> undolist

msg : UndoList.Msg Json.Encode.Value -> Json.Encode.Value

Encode an UndoList Msg of JSON values. Best paired with the mapMsg function from UndoList.

encodeMsg msgEncoder =
    UndoList.mapMsg msgEncoder >> msg