Skip to content
Nested client-side routing for Reflex-DOM
Haskell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Reflex/Dom/Routing
CHANGELOG.md
LICENSE
README.md
reflex-dom-nested-routing.cabal

README.md

Nested Routing for Reflex-DOM

Haskell Programming Language BSD3 License

Example:

app = runRouteWithPathInFragment $ do
  switchPromptly never <=< withRoute $ \route -> case fromMaybe "" route of
    ""         -> (["users"] <$) <$> buttonClick "Open users"
    "users"    -> users
    "test"     -> codeToRun >> pure never
    "settings" -> text "Settings" >> pure never
    _          -> redirectLocally []

RouteWriter can make plumbing easer:

app = runRouteWithPathInFragment $ fmap snd $ runRouteWriterT $ do
  void $ withRoute $ \route -> case fromMaybe "" route of
    ""         -> tellRouteAs ["users"] =<< buttonClick "Open users"
    "users"    -> users
    "test"     -> codeToRun
    "settings" -> text "Settings"
    _          -> tellRedirectLocally []
You can’t perform that action at this time.