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

Need API advice for a little TS & ReScript library

$
0
0

Hello, hello,

I create a little state management library (in the mindset of Overmind.js which I enjoyed a lot) but am stuck with a some design decisions regarding TS / ReScript.

A familiar API for ReScript would be:

// *************** ReScript use
let tree = Libname.make({count: 0, total: 0})

// And ins some @react.component
let c = Libname.use(tree)

But in TS, one would expect:

// *************** TypeScript use
import { libname, useLibname } from "@libname/react"

const tree = libname({count: 0, total: 0})

// and in a react component
const t = useLibname(tree)

I have no experience publishing ReScript libraries (I am not even aware of what is published: .res sources or .resi and js ?).

How can I build the two librairies from the rescript files but not expose useLibname or tilia in ReScript or use and make in TypeScript ?


Viewing all articles
Browse latest Browse all 2592

Trending Articles