Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/3noch/reflex-dom-nested-routing
Nested client-side routing for Reflex-DOM
https://github.com/3noch/reflex-dom-nested-routing
client-side client-side-routing javascript nested-router reflex-frp routing
Last synced: about 2 months ago
JSON representation
Nested client-side routing for Reflex-DOM
- Host: GitHub
- URL: https://github.com/3noch/reflex-dom-nested-routing
- Owner: 3noch
- License: bsd-3-clause
- Created: 2017-10-07T02:07:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-07T02:27:18.000Z (over 2 years ago)
- Last Synced: 2024-10-11T23:42:32.477Z (2 months ago)
- Topics: client-side, client-side-routing, javascript, nested-router, reflex-frp, routing
- Language: Haskell
- Size: 24.4 KB
- Stars: 11
- Watchers: 5
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Nested Routing for Reflex-DOM
[![Haskell Programming Language](https://img.shields.io/badge/language-Haskell-blue.svg)](http://www.haskell.org)
[![BSD3 License](http://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)Example:
```haskell
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:
```haskell
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 []
```