Currently, the Router type from WebSharper.Sitelets is available for client-side use through a macro. This enables creating routers for endpoint types on the client, which is often used in SPAs in combination of hashed URLs:
open WebSharper.Sitelets
open WebSharper.UI
// SPA endpoints
type EndPoint =
| [<EndPoint "/">] Home
| [<EndPoint "/counter">] Counter
// Creating a client-side router
let router = Router.Infer<EndPoint>()
// Installing it and tracking the current page via an RV
let currentPage = Router.InstallHash EndPoint.Home router
Given this, it would be desirable to be able to compute hash-based URLs, instead of manually accounting for the hash - which looks something like:
Currently, the
Router
type fromWebSharper.Sitelets
is available for client-side use through a macro. This enables creating routers for endpoint types on the client, which is often used in SPAs in combination of hashed URLs:Given this, it would be desirable to be able to compute hash-based URLs, instead of manually accounting for the hash - which looks something like:
This ticket would add this as an extension member to
Router<'T>
, whenWebSharper.UI
is opened.