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

How can i bind this?

$
0
0
const StorageManager = require("xyz");

const { Storage } = new StorageManager(config)

Storage({
  path: 'test'
})

I have this code to bind, Storage() function can accept any object
i have tried this binding:

type fnType<'a> = 'a => T.t
type initReturn = {"Storage": fnType<'a>}
@new @module external init: folderOptions => initReturn = "xye"

let folder = init({
  redis: {
    prefix: "storage:file:",
    password: Env.redis_password,
    ip: Env.redis_ip,
  },
})["Storage"]

But it give me the error "Unbound type parameter 'a "

How can i make this work,keeping Storage() function accepting any parameter?


Viewing all articles
Browse latest Browse all 2592

Trending Articles