reasonml-community/bs-express

Response.render() type

kevanstannard opened this issue · 1 comments

I'm new to Reason/ReScript so appreciate any guidance.

Currently render() has the following type.

let render: (string, Js.Dict.t(string), 'a, t) => complete;

I.e. the data is a Js.Dict.t(string)

In the past when I've use Express I might have passed in data such as:

{
  user: { first: "Jo", last: "Smith" },
  products: [{ id: 1, name: "Product 1" }],
}

And the template would be crafted to handle those types, including looping over the products, for example.

What would be the correct strategy for handling types like those here?

Thanks

I've switched to rendering server side React which seems to be working well, so closing this issue.