inline-js
inline-js copied to clipboard
Allow code blocks into quasiquotes
Is your feature request related to a problem? Please describe. In order to insert a Haskell type into the quasiquotes, I always have to make dummy values:
newtype Foo = Foo { unFoo :: ByteString }
let foo' = unFoo foo
[js|
$foo // do something with foo
|]
Describe the solution you'd like
It'd be nice to be able to unwrap the Foo
within the quasiquotes:
[js|
${unFoo foo}
|]
Also, does this library support inserting a JSExpr
to another JSExpr
? Here is what I'd like to do:
let a = [js|const examplePackage = require("package")|]
b =
[js|
$a
// do more work using examplePackage
|]