1.1.2 ā€¢ Published 6 years ago

re-elm-app v1.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

This project isn't as good as this other project!

https://github.com/jaredramirez/reason-elm

šŸ‘† use that one instead!

re-elm-app

yarn add re-elm-app

Then add

  "bs-dependencies": ["re-elm-app"]

to your bsconfig.json.

Then you can use it like this (assuming you have some webpack setup that can import Elm files like elm-webpack-loader):

[@bs.module "./Main.elm"] external main : ElmApp.unmounted = "Main";

/* These are just some example flags. It's just a json value */
let flags =
 Js.Dict.fromList([
   ("images", images),
   ("publicUrl", publicUrl),
   ("user", userJson)
 ]);

/* Mount the app, and then you can subscribe to its ports. Here the callbacks specified below are just functions (not shown in this example) which take Js.Json.t and return unit. */
ElmApp.mount("#root", flags, main)
|> ElmApp.subscribeToPort("log_", onElmLog)
|> ElmApp.subscribeToPort("toJS", onElmMsg)
1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago