From f2ef0c2ca92cd744e052ccceb388dcd212018851 Mon Sep 17 00:00:00 2001 From: Thomas Crowley Date: Fri, 15 May 2015 11:42:29 +1000 Subject: [PATCH] Add `push-state!` fn for backwards compatibility with 0.2.2 --- src/pushy/core.cljs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pushy/core.cljs b/src/pushy/core.cljs index cc29d69..112a05b 100644 --- a/src/pushy/core.cljs +++ b/src/pushy/core.cljs @@ -121,3 +121,12 @@ "Returns whether Html5History is supported" ([] (supported? js/window)) ([window] (.isSupported Html5History window))) + +;; Backwards compatibility with pushy <= 0.2.2 +(defn push-state! + ([dispatch-fn match-fn] + (push-state! dispatch-fn match-fn identity)) + ([dispatch-fn match-fn identity-fn] + (let [h (pushy dispatch-fn match-fn identity-fn)] + (start! h) + h)))