Is there a option to generate getter for method in a record?
E. g., for this ReScript code:
type state = Init
type api = {state: unit => state}
let instance: api = {
let state = ref(Init)
{state: () => state.contents}
}
In the generated js code can we replace state
instance method:
var instance = {
state: (function () {
return state.contents;
})
};
with a state
getter?:
var instance = {
get state() {
return state.contents;
}
};