Skip to content

Commit f2ef0c2

Browse files
committed
Add push-state! fn for backwards compatibility with 0.2.2
1 parent 6d12d48 commit f2ef0c2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pushy/core.cljs

+9
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,12 @@
121121
"Returns whether Html5History is supported"
122122
([] (supported? js/window))
123123
([window] (.isSupported Html5History window)))
124+
125+
;; Backwards compatibility with pushy <= 0.2.2
126+
(defn push-state!
127+
([dispatch-fn match-fn]
128+
(push-state! dispatch-fn match-fn identity))
129+
([dispatch-fn match-fn identity-fn]
130+
(let [h (pushy dispatch-fn match-fn identity-fn)]
131+
(start! h)
132+
h)))

0 commit comments

Comments
 (0)