From cad2b831ed85d235d37e206dea37a01dd9a16d30 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 26 May 2021 16:30:23 +0200 Subject: [PATCH] :sparkles: Make the navigation async by default. This leaves some time to eventloop to terminate other async events before navigate. --- frontend/src/app/util/router.cljs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/util/router.cljs b/frontend/src/app/util/router.cljs index 0fc55dc8f..d7945580d 100644 --- a/frontend/src/app/util/router.cljs +++ b/frontend/src/app/util/router.cljs @@ -84,12 +84,13 @@ ptk/EffectEvent (effect [_ state stream] - (let [router (:router state) - history (:history state) - path (resolve router id params qparams)] - (if ^boolean replace - (bhistory/replace-token! history path) - (bhistory/set-token! history path)))))) + (ts/asap + #(let [router (:router state) + history (:history state) + path (resolve router id params qparams)] + (if ^boolean replace + (bhistory/replace-token! history path) + (bhistory/set-token! history path))))))) (defn nav ([id] (nav id nil nil))