| Safe Haskell | Safe-Infered |
|---|
Language.Elm.Yesod
Description
This module provides a function for compiling Elm source code into a Yesod widget. In order to use this with your Yesod app, you need to define a defaultLayout like function that embeds the elm-min.js file in the <head> tag.
For example, you could modify your Yesod instance as follows:
instance Yesod App where
jsLoader _ = BottomOfHeadBlocking -- moves JS to the <head> tag
You also need to define an instance of YesodElm, which will specify
where to find the elm-min.js file.
A full example implementation is provided in the examples folder of the Elm github repository at https://github.com/tazjin/Elm/tree/master/Examples/elm-yesod.
Documentation
elmWidget returns a Yesod widget from some Elm source code with URL interpolation.