Finding out what JSON I'm trying to decode

Hiya,

I’ve hit a wall.

I’m trying to write a method to handle “Html.Event.on”

The first parameter is the method the second is a JSON Decoder.Decoder

I’m trying to work out what the string I will be decoding looks like, but I can’t get to it to print it.

I have to use a JSON.Decoder.Decoder. I was hoping t find one that just didn’t decode, so I could print the original string as is, then I’d know what I was looking for.

I’ve also tried decoding to a Value then Reencoding to String, since, But I think I was working under the assumption that Value would work something like it does in Rust, where Value is a kind of Enum, and I still needed to know what kind of Value I was expecting.

Is there a way to just get the original string out of a JSON.Decoder.Decoder

Thanks

I

You could use Json.Decode.value to get the raw object, throw it over to your update in a temporary message, and then send it to a port where you can do console.log

Thankyou, it worked, I’ve now got a new problem, in that id didn’t have the data I needed, but still I have a better idea where to be looking

Like it did work, but all I got from the object is
{ "isTrusted": true }

I was hoping to find the value of the <input type="range"></input>

Any ideas where I can get that from, as an integer.

Nevermind the simple answer solved my problems, I don’t understand how, looking it works underneath, but just using onInput with a String.toInt worked Thanks again

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.