With purescript 0.14 I was exposing my main purescript functions in main.purs to the browser .window with with
main.js
exports._mainImpl = function() {
return window.PS = PS;
}
main.purs
foreign import _mainImpl :: Effect Unit
main :: Effect Unit
main = _mainImpl
renderBookmarks :: String -> Array Bookmark -> Effect Unit
Then I could call renderBookmarks
from JS with PS['Main'].renderBookmarks(...)
with purescript 0.15 + esbuild there is no longer a PS variable in scope in main.js and my bundle.js doesn’t appear to have main.purs renderBookmarks
code bundled; only main
is bundled.
Is there some way i can import the other main.purs functions and expose that in main.js in ps v0.15?
in this example I want to expose the main.purs function renderBookmarks
to the window globally so that it can be called externally