Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Naming conflicts between models and components

$
0
0

In my projects, I typically make a data module, for my Entities or end points. These are the ones that follow the type t convention along with utils for fetching data.

Using a blog just as an example, I’d probably have a Comment.res module:

type t = {
  author: string,
  content: string
}

let fetchById = (commentId) => // ...
let fetchForPost = (postId) => // ...

The conflict comes when getting to the UI, naturally I’d also want to create a Comment.res file for the react component. But the name clashes.

Does anybody else struggle with this? Do you have a convention you like to avoid it?


Viewing all articles
Browse latest Browse all 2592

Trending Articles