I’m trying to receive a JS object and use it as a record and I’m utterly failing while trying to write some bindings.
This is how I’m trying to expose fsCollection:
[@bs.deriving {jsConverter: newType}]
type fsCollection = {find: (selector, options) => file};
[@bs.module "react-native-meteor"]
external _FSCollection : string => abs_fsCollection = "FSCollection";
let fsCollection = (collection: collection) : fsCollection => {
let fsObj = _FSCollection(collectionToJs(collection));
fsCollectionFromJs(fsObj);
};
but when trying to use the fsCollection record like this let {find} = Meteor.fsCollection(``personImages); I get Error: Unbound record field find.
What am I doing wrong?