Skip to content
Snippets Groups Projects
Commit f3942ae7 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

some explainers

parent 6f93fefe
No related branches found
No related tags found
1 merge request!41Add a tech demo button showing browser history integration
Pipeline #4452 passed
......@@ -119,9 +119,17 @@ techDemoPage = prerender_ (pure ()) $ do
-- | Render a "Back" button hooked up to the browser history navigation action "back".
navigationDemo :: (Prerender t m, DomBuilder t m) => m ()
navigationDemo = do
-- This renders a button into the page so there is something to see and
-- click on. It returns an `Event t ()` that triggers when the button is
-- clicked.
backEv <- button "Back"
prerender_ blank $ do
-- performEvent_? Why?
-- Only do the rest of this on the client. There's no way to look up the
-- browser Window or History when doing server-side rendering.
prerender_ blank $
-- Use performEvent_ to take an action on the Window whenever the event
-- triggers.
performEvent_ . ffor backEv $ \() -> do
windowM <- currentWindow
case windowM of
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment