-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I have a couple coders for single-case unions:
let itemIDEnc (ItemID id) =
Encode.string id
let itemIDDec : Decoder<ItemID> =
Decode.map ItemID Decode.string
let extras =
Extra.empty
|> Extra.withCustom itemIDEnc itemIDDec
|> Extra.withInt64
And I receive it fairly straightforwardly:
let cmd = promise {
return! Fetch.tryPost(Routes.query, q, extra = JsonCodecs.extras)
}
m, Cmd.OfPromise.perform
(fun () -> cmd :?> JS.Promise<Result<QueryResult, FetchError>>) ()
(fun r -> QueryResultReceived (TabID 1, r))
QueryResult has a couple int64s in there, so it'll complain if I don't have the withInt64
in there, but it still loses precision, and the other ItemID just takes on a raw string value, which causes an invalid access exception later on when I try to retrieve the value.
The same coders work fine on the encoder side.
What could be going on here?
Metadata
Metadata
Assignees
Labels
No labels