Hi all
I request the data to the server as following:
Axios.getWithConfig(url, Axios.config(~headers, ()));
})
|> Js.Promise.then_((resp: Currencies.t) => {
Js.Promise.resolve(Js.log(Currencies.status(resp)))
});
As response, I force it to be the type Currencies.t
that has following definition:
module Currencies = {
[@bs.deriving abstract]
type t = {
status: int,
data: array(string)
}
};
It works fine, but I do not know, if I violate the language. It exists the lib https://github.com/glennsl/bs-json to convert JSON to reasonml but the example above works fine too.
Thanks