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 in 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 libname
in ReScript or use
and make
in TypeScript ?