Decode UndoList submodule.
Provides JSON decoders for Timelines and UndoList Messages.
Decode an undo-list msg given a decoder of messages.
import Json.Decode
import UndoList exposing (Msg(..))
Json.Decode.decodeString (msg Json.Decode.string) "{ \"New\": \"Hello!\" }"
--> Ok (New "Hello!")
json : String
json = """[ "Reset", "Redo", "Undo", "Forget", { "New": 1 } ]"""
Json.Decode.decodeString (Json.Decode.list <| msg Json.Decode.int) json
--> Ok [ Reset, Redo, Undo, Forget, New 1 ]
Decode an undo-list given a decoder of state.