File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ You can construct a new instance by calling the `pushy` function.
18
18
* ` dispatch ` fn: gets called when there is a match
19
19
* ` match ` fn: checks if the path matches any routes defined.
20
20
21
- Optionally, you can specify an ` :identity-fn ` which parses and returns the route based on the result of the ` match ` fn.
21
+ Optionally, you can specify an ` :identity-fn ` which parses and returns the route based on the result of the ` match ` fn.
22
22
23
23
### Event listeners
24
24
@@ -123,7 +123,29 @@ pushy should work with any routing library:
123
123
124
124
#_(pushy/set-token! history " /" )
125
125
#_(pushy/set-token! history " /pages" )
126
-
126
+ ```
127
+
128
+ [ Sibiro] ( https://github.com/aroemers/sibiro )
129
+
130
+ ``` clojure
131
+ (ns foo.core
132
+ (:require [sibiro.core :as sibiro]
133
+ [pushy.core :as pushy]))
134
+
135
+ (def state (atom {}))
136
+
137
+ (defn set-page! [match]
138
+ (assoc state :page match))
139
+
140
+ (def routes
141
+ {[:get " /home" :home ]})
142
+
143
+ (defn match-uri [uri]
144
+ (:route-handler (sibiro/match-uri (sibiro/compile-routes routes) uri :get )))
145
+
146
+ (def history (pushy/pushy set-page! match-uri))
147
+
148
+ (pushy/start! history)
127
149
```
128
150
129
151
### URL handling
You can’t perform that action at this time.
0 commit comments