module Web.Front where
import Data.Text (Text)
import Bridge
import Text.Blaze.Front
import Text.Blaze.Front.Renderer
import qualified Data.Text as T
createTask
:: Show a
=> Text
-> (t -> Markup a)
-> t
-> ClientTask a
createTask eid renderer state = task
where rhtml = AttachText eid (T.pack . renderHtml $ markup)
markup = renderer state
task = ClientTask
{ executeRenderHtml = [rhtml]
, executeAction = registerEvents markup []
}
emptyTask :: ClientTask a
emptyTask = ClientTask { executeRenderHtml = [], executeAction = [] }