Skip to content

Commit 1c46847

Browse files
committed
Moved the interface out of the routing config
1 parent e6ee7a7 commit 1c46847

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ A basic pushstate router for React, with support for asynchronous routing logic.
66
makeRouter ::
77
forall route f.
88
Foldable f =>
9-
{ interface :: PushStateInterface
10-
, fallback :: route
9+
PushStateInterface ->
10+
{ fallback :: route
1111
, parse :: String -> f route
1212
, print :: route -> String
1313
, onRoute :: route -> Router route Transitioning Resolved Unit

examples/RoutingDuplex.purs

+2-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ makeApp :: Effect (Unit -> JSX)
4242
makeApp = do
4343
interface <- PushState.makeInterface
4444
router <-
45-
Router.makeRouter
46-
{ interface
47-
, fallback:
45+
Router.makeRouter interface
46+
{ fallback:
4847
-- used as the initial route if the parser fails
4948
NotFound
5049
, parse: parse routes

generated-docs/md/Wire.React.Router.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#### `makeRouter`
44

55
``` purescript
6-
makeRouter :: forall f route. Foldable f => { fallback :: route, interface :: PushStateInterface, onRoute :: route -> Router route Transitioning Resolved Unit, parse :: String -> f route, print :: route -> String } -> Effect (Interface route)
6+
makeRouter :: forall f route. Foldable f => PushStateInterface -> { fallback :: route, onRoute :: route -> Router route Transitioning Resolved Unit, parse :: String -> f route, print :: route -> String } -> Effect (Interface route)
77
```
88

99

src/Router.purs

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ type Interface route
3131
makeRouter ::
3232
forall f route.
3333
Foldable f =>
34-
{ interface :: PushStateInterface
35-
, fallback :: route
34+
PushStateInterface ->
35+
{ fallback :: route
3636
, parse :: String -> f route
3737
, print :: route -> String
3838
, onRoute :: route -> Router route Transitioning Resolved Unit
3939
} ->
4040
Effect (Interface route)
41-
makeRouter { interface, fallback, parse, print, onRoute } =
41+
makeRouter interface { fallback, parse, print, onRoute } =
4242
let
4343
onPushState k = PushState.matchesWith parse (\_ -> k) interface
4444

0 commit comments

Comments
 (0)