Skip to content

Commit

Permalink
Merge pull request #6 from pupeno/patch-1
Browse files Browse the repository at this point in the history
Add example for Silk
  • Loading branch information
wavejumper committed Jul 23, 2015
2 parents dc651cd + 616b81b commit eaec538
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,27 @@ pushy should work with any routing library:
(pushy/start! history)
```

[Silk](https://github.com/DomKM/silk)

```clojure
(ns foo.core
(:require [domkm.silk :as silk]
[pushy.core :as pushy]))

(def state (atom {}))

(def app-routes
(silk/routes [[:foo [["/foo"]]]]))

(defn set-page! [match]
(swap! state assoc :page match))

(def history
(pushy/pushy set-page! (partial silk/arrive app-routes)))

(pushy/start! history)
```

### goog.history.HTML5History methods

You can set the history state manually by calling the `set-token!` method. This will call the `dispatch` fn on a successfully matched path.
Expand Down

0 comments on commit eaec538

Please sign in to comment.