You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A basic pushstate router for React, with support for asynchronous routing logic. Built using [react-basic-hooks](https://github.com/spicydonuts/purescript-react-basic-hooks) and [wire](https://github.com/robertdp/purescript-wire). I recommend [routing-duplex](https://github.com/natefaubion/purescript-routing-duplex) for easy parsing and printing.
4
+
5
+
```purescript
6
+
makeRouter ::
7
+
forall route f.
8
+
Foldable f =>
9
+
{ interface :: PushStateInterface
10
+
, fallback :: route
11
+
, parse :: String -> f route
12
+
, print :: route -> String
13
+
, onRoute :: route -> Router route Transitioning Resolved Unit
14
+
} ->
15
+
Effect
16
+
{ signal :: Signal (Route route)
17
+
, component :: JSX
18
+
, navigate :: route -> Effect Unit
19
+
, redirect :: route -> Effect Unit
20
+
}
21
+
```
22
+
23
+
For a basic example see [`examples/RoutingDuplex.purs`](https://github.com/robertdp/purescript-wire-react-router/blob/master/examples/RoutingDuplex.purs).
0 commit comments