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

How to use @taggedTemplate generate js with tagged template literals

$
0
0

what do you mean by object functions?

In the meanwhile, the easiest solution by far is just to initialize your sql function in raw js and bind to it:

%%raw(`import Postgres from "postgres"
let sql = Postgres("postgres://xxx:xxxx@localhost:5432/xxxxxx")`)
@taggedTemplate
external sql: (array<string>, array<'sqlParam>) => promise<'data> = "sql"

let foo = sql`hello`

Playground link


Viewing all articles
Browse latest Browse all 2592

Trending Articles